As it says in the title; if yes, I would, of course, need a bash-like pipe in order to use it comfortably.
3 回答
如果你的系统有OSS
,你可以使用gtacl
。gtacl
允许您直接从原生启动一个又名TACL
Guardian 程序。OSS
grep
要将会话从 Guardian 切换TACL
到OSS
,首先键入osh
,然后您可以简单地TACL
通过运行命令gtacl -c STATUS *, DETAIL
(这是一个用户状态示例)。
您可以TACL
在 in 中以这种方式运行所有命令,就像在会话中必须为as (例如 osh 进程检查 ssh)OSS
运行所有命令一样。osh
OSS
osh -c "ps -e~|egrep -e 'sshd~|prngd'"
TACL
我假设您想知道如何通过 tacl 从文件中搜索字符串
读取文件到变量
FILETOVAR file-name variable-level
exmple: FILETOVAR $AAA.BBB.CCC var
$AAA.BBB.CCC: filename
var: variable name
在 var 中查找字符串
VFIND var string
var:variable name
string : target string
Grep 做了很多事情。
如果您在特定文件中查找字符串,则命令:EDIT R;LB/String/All;E
将查看单个可编辑文件(类型 101)。
如果您正在查看 $ 中的多个文件。目录,没有任何 HPNonStop 实用程序可以完成此操作。
您可以用 TACL 代码围绕上面的单个文件示例来查看所有可编辑文件。就像是:
寻觅
?TACL Macro
#Frame
#Push StringToFind FileName StopLoop Vol SubVol
#Set StopLoop 0
#Set StringToFind %1%
#SetMany Vol SubVol, [#Fileinfo/volume,subvol/[#Defaults/Current/ ].a]
[#If [#Empty [StringToFind]]
|then|
#Output Usage: Please supply the string to find
#Output EG: Foofind foo
|else|
#Set Filename [#Defaults/Current/].a
[#Loop
|do|
#Set FileName [#NextFileName [FileName]]
[#If [#Match [Vol] [#fileinfo/Volume/[FileName]]]
And [#Match [Subvol] [#fileinfo/Subvol/[FileName]]]
|then|
[#If [#Match 101 [#fileinfo/Code/[FileName]]]
|then|
Edit [FileName] r;lb/[StringToFind]/;Exit
|else|
#Output [FileName] is not an Edit file. Skipping...
] == end of if
|else|
#Set StopLoop -1
] == end of if
|Until| [StopLoop]
] == end of loop
] == end of if
#UnFrame
执行:
$DATA FOO 73> 查找
用法:请提供要查找的字符串
例如:Foofind foo
$DATA FOO 74> foofind foo
文本编辑器 - T9601L01 - (20OCT14)
当前文件是 $DATA.FOO.FOO1
文本编辑器 - T9601L01 - (20OCT14)
当前文件是 $DATA.FOO.FOO2
1 there is a foo here
文本编辑器 - T9601L01 - (20OCT14)
当前文件是 $DATA.FOO.FOO3
1 And a foo foo here.
文本编辑器 - T9601L01 - (20OCT14)
当前文件是 $DATA.FOO.FOOFIND
12 #Output EG: Foofind foo
$DATA.FOO.NOTEDIT 不是编辑文件。跳过...
$DATA FOO 75>
这是相当初级的。有很大的提升空间。但它确实完成了在卷/子卷目录中的所有可编辑文件中查找输入字符串的任务。
但是,如果您正在寻找一个类似 grep 的实用程序来搜索非编辑文件,那么最好的办法是通过编程语言来做一些事情。