Tcsh script does not exit

[亡魂溺海] 提交于 2019-12-07 07:16:42

问题


I am running CentOS 7, and I am having problems with tcsh scripts.

I have a simple script called quittest.

#!/bin/tcsh
echo "Simple Test"
exit 0

When I run quittest from the terminal, I get

"Simple Test"

And it does not exit. I can Control+C to exit. I check on the status of this with:

ps aux

and it shows quittest with a state of S+ (foreground interruptible sleep). If I change this script to bash, or sh, it runs fine, and exits as expected.

I cannot just switch to another shell, because my users have very complex scripts written with tcsh. We are replacing OpenSuSE 12.3 with CentOS 7.

Tcsh version 6.18.01-7. SELinux is set to permissive for testing this issue.


回答1:


Turns out, my ~/.history file was the issue. I deleted that and the script ran as intended. Must have gotten hung up with a permissions issue at some point.




回答2:


I had the same problem on all my Fedora 23, tcsh version 6.19.00-3.fc23.
Reason was ~/.history.lock file. Removing lock file resolved this issue.



来源:https://stackoverflow.com/questions/35708942/tcsh-script-does-not-exit

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