首页 > 系统服务 > 详细

【转】shell脚本执行时报"bad interpreter: Text file busy"的解决方法

时间:2017-08-19 19:20:41      阅读:615      评论:0      收藏:0      [点我收藏+]

1)问题现象:

在ubuntu下执行以下脚本( while_count),报错:

 -bash: ./while_count: /bin/bash: bad interpreter: Text file busy

 

2)问题原因:

 This happens because the script file is open for writing, possibly by a rogue process which has not terminated.

3)解决办法:

Solution: Check what process is still accessing the file, and terminate it.

Run lsof (list open files command) on the script name:

lsof | grep while-count
cat 17653 me   1w REG 8,1 148 181517 /home/me/test/while-count

kill -9 17653

Now try running the script again. It works now.

【转】shell脚本执行时报"bad interpreter: Text file busy"的解决方法

原文:http://www.cnblogs.com/ybluo/p/7397426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!