我想从一个脚本启动一个长时间运行的进程,然后退出,但我无处可去。这是我最简单的测试。每次运行时,控制台都会被阻塞5秒钟。Linux:在子shell中运行
// Create script
[email protected]:~/workspace/bin$ cat > test.sh
sleep 5
// Verify script
[email protected]:~/workspace/bin$ cat test.sh
sleep 5
// Make executable
[email protected]:~/workspace/bin$ chmod 777 test.sh
// Expect to wait
[email protected]:~/workspace/bin$ ./test.sh
// Expect to return, still waits
[email protected]:~/workspace/bin$ ./test.sh ?
// Ditto
[email protected]:~/workspace/bin$ nohup ./test.sh ?
nohup: ignoring input and appending output to 'nohup.out'
[email protected]:~/workspace/bin$
我运行Ubuntu 17.04 64, GNU的bash,版本4.4.7(1)-release下(x86_64-PC-Linux的GNU)
我是一个Linux小白,我我确定我没有得到什么。任何帮助表示赞赏。
是的。它有助于使用正确的字符。真的,谢谢你指出。 –
Steve11235