当 shell 脚本被 Java 运行时执行时,nohup.out 文件会在哪里创建?

where will be nohup.out file created when shell script is executed by Java Runtime?

当我通过 java Runtime.exec() 执行 shell 脚本时,我在哪里可以找到 nohup.out 文件。

字符串命令="nohup ksh /home/xyz/script.ksh &";

运行时 rtime=Runtime.getRuntime();

rtime.exec(命令);

nohup 仅在连接到终端时将输出写入文件。当您通过 exec 调用它时不会出现这种情况,因此输出将写入子进程的标准输出(您可以通过 getInputStream 获得)。不会在任何地方创建 nohup.out