我想将程序的输出保存到变量中。
我使用以下方法,但失败了。
$ PIPE RUN TEST | DEFINE/JOB VALUE @SYS$PIPE
$ x = f$logical("VALUE")
我收到一个错误:%DCL-W-MAXPARM, too many parameters - reenter command with fewer parameters
\WORLD\
参考 :如何将程序的输出分配给 VMS 上 DCL com 脚本中的变量? https://stackoverflow.com/questions/4431757/how-to-assign-the-output-of-a-program-to-a-variable-in-a-dcl-com-script-on-vms
通常的方法是将输出写入文件并从文件中读取并将其放入 DCL 符号(或逻辑符号)中。虽然不明显,但您可以使用 PIPE 命令来完成此操作:
$ pipe r 2words
hello world
$ pipe r 2words |(read sys$pipe line ; line=""""+line+"""" ; def/job value &line )
$ sh log value
"VALUE" = "hello world" (LNM$JOB_85AB4440)
$
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)