英文:
FSUM7332 - expecting new line when using bpxwunix under z/OS
问题
sftp 1216: FSUM7332 语法错误:得到 ), 期望 Newline
我已经为REXX中的sftp创建了一个'批处理'文件,并使用address syscall writefile
将数据写入文件。
通过bpxwunix这样调用sftp:sftp -b batchfile userid@host
文件是这样创建的:
stdin = workdir/'sysvar('sysuid')'.sftp.stdin
out.1 = 'put' workdir/'filename'
out.2 = 'quit'
out.0 = 2
address syscall 'writefile (stdin) 700 out.'
我尝试在每个stem行的末尾添加'25'x,但没有成功。
英文:
sftp 1216: FSUM7332 syntax error: got ), expecting Newline
I've created a 'batch' file for sftp in REXX and have used the address syscall writefile
to write out the data to the file.
the sftp is invoked using bpxwunix thus: sftp -b batchfile userid@host
The file is created thus:
stdin = workdir'/'sysvar('sysuid')'.sftp.stdin'
out.1 = 'put' workdir'/'filename
out.2 = 'quit'
out.0 = 2
address syscall 'writefile (stdin) 700 out.'
I tried to add '25'x
at the end of each stem line without success.
答案1
得分: 2
我可以回答为什么在运行bpxwunix
时,传递的命令是sh sftp ....
会出错:
bpxwunix
启动一个shell,就好像键入了sh -c command
一样,其中command
是传递给bpxwunix
的第一个参数。如果将sh sftp ...
作为command
传递,bpxwunix
将启动一个shell,即sh -c sh sftp ...
,因此要运行的shell命令是sh
。
如果以这种方式调用sh
,则将第一个单词视为shell命令文件,从中shell尝试读取命令。在您的情况下,shell尝试从文件sftp
中读取命令,而该文件是一个二进制文件。您收到的错误是任意的,并且取决于从文件中读取的字节。尝试将sh ls
作为命令发送给bpxwunix
,您将得到一些不同的错误。
英文:
I can answer why you get an error when running bpxwunix
with the command passed being sh sftp ....
:
bpxwunix
starts a shell as if sh -c command
has been typed, where command
is the first parameter to bpxwunix
. If you pass sh sftp ...
as the command
, bpxwunix
will start a shell as sh -c sh sftp ...
, so the shell command to be run is sh
.
If sh
is called that way, the first word is taken as a shell command file, from which the shell tries to read commands. In your case, the shell tries to read commands from file sftp
, which is a binary. The error you get is arbitrary, and depends on the bytes read from the file. Try sending sh ls
as command to bpxwunix
, and you get some different error.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论