TCSH脚本不退出 [英] Tcsh script does not exit
问题描述
我正在运行CentOS 7,tcsh脚本出现问题.
I am running CentOS 7, and I am having problems with tcsh scripts.
我有一个简单的脚本,称为quittest.
I have a simple script called quittest.
#!/bin/tcsh
echo "Simple Test"
exit 0
从终端运行quittest时,我得到
When I run quittest from the terminal, I get
"Simple Test"
它不会退出.我可以按Control + C退出.我用以下方法检查其状态:
And it does not exit. I can Control+C to exit. I check on the status of this with:
ps aux
ps aux
,它显示状态为S +(前景可中断睡眠)的退出测试.如果我将此脚本更改为bash或sh,它可以正常运行,并按预期退出.
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.
我不能仅仅切换到另一个shell,因为我的用户使用tcsh编写了非常复杂的脚本.我们正在用CentOS 7代替OpenSuSE 12.3.
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版本6.18.01-7. SELinux已设置为允许测试此问题.
Tcsh version 6.18.01-7. SELinux is set to permissive for testing this issue.
推荐答案
结果是,我的〜/.history文件是问题所在.我删除了该脚本,脚本按预期运行.一定在某个时候挂了权限问题.
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.
这篇关于TCSH脚本不退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!