码迷,mamicode.com
首页 > 系统相关 > 详细

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

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

标签:mina   term   erp   grep   解决方法   rmi   nat   test   bsp   

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"的解决方法

标签:mina   term   erp   grep   解决方法   rmi   nat   test   bsp   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!