Why do I get the information of “suspended (tty input)” when I run my script in the background

梦想的初衷 提交于 2019-12-06 04:28:03

问题


I've written a tcsh script to clear garbage data in a cluster, the code is :

set hosts = $1
set clear_path = $2
foreach i ($hosts)
    rsh $i rm -rvf $clear_path
end

When I run this script in the background like this :

disk_clean.sh hosts_all /u0/data/tmp > log &

The job will get stuck and show the information like this:

[1] + Suspended (tty input)

If I run this in foreground, it can finish normally. Why does this happen? How can I run this script in the background and redirect the output into a log file?

来源:https://stackoverflow.com/questions/42361200/why-do-i-get-the-information-of-suspended-tty-input-when-i-run-my-script-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!