pwd /origdir -6ren">
gpt4 book ai didi

zos - 更改在 z/OS USS 中运行的 REXX exec 中的目录?

转载 作者:行者123 更新时间:2023-12-04 18:34:30 38 4
gpt4 key购买 nike

我在 TSO 下的 USS shell 中,我有这个 exec(名为 tryit):

/* rexx */
"cd /differentdir"
"pwd"

结果如下:

> pwd
/origdir
> tryit
/origdir

换句话说,cd 命令的效果似乎只持续到命令本身的持续时间。 REXX exec 是否可以通过以下命令识别的方式更改工作目录?

最佳答案

对于在 USS shell 下运行的 REXX exec,默认寻址环境是 SH。来自 Using REXX and z/OS UNIX System Services 手册:

Note that built-in shell commands run in the shell process, not your REXX process and cannot alter the REXX environment. For example, address sh 'cd /' will not change the current directory of your REXX process.

要对当前工作目录进行持久更改,请发出 address syscall chdir 命令。来自同一手册:

If you use chdir to change a directory in a REXX program that is running in a TSO/E session, the directory is typically reset to your home directory when the REXX program ends.

关于zos - 更改在 z/OS USS 中运行的 REXX exec 中的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43208846/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com