我是Linux的新手。
我有一个使用Perl编写的脚本,需要两个命令行参数。我尝试在后台运行它,但遇到了以下问题:
[~user]$ nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv &
[2] 19603
[~user]$ nohup: appending output to `nohup.out'
系统返回"nohup: appending output to `nohup.out'"后,将不会出现新的提示符。只要我输入其他命令,shell就会告诉我该进程已停止:
[~user]$ nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv &
[2] 19603
[~user]$ nohup: appending output to `nohup.out'
ls
ascii_loader_script.pl format_wrds_trd.txt nohup.out norm_wrds_trd.cfg
[2]+ Stopped nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv
我查看了这篇文章,并尝试在执行命令之前执行“sudo date”。仍然得到了相同的结果。http://www.sudo.ws/pipermail/sudo-users/2003-July/001648.html
nohup
来保护进程不被关闭,如果是的话,您最好使用screen
。 - Januarysudo echo hi
或其他命令添加到您的.bashrc
文件中,这样您只需在开始时输入一次密码。 - phil294