【转】shell脚本执行时报"bad interpreter: Text file busy"的解决方法
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"的解决方法的更多相关文章
- shell脚本执行时报"bad interpreter: Text file busy"的解决方法
在执行一个shell脚本时,遇到了“-bash: ./killSession.sh: /bin/bash: bad interpreter: Text file busy”错误提示,如下所示: [or ...
- shell脚本:Syntax error: Bad for loop variable错误解决方法(转)
Linux Mint中写了一个简单的shell脚本,利用for..do..done结构计算1+2+3......+100的值,结果执行"sh -n xxx.sh"检测语法时总是报错 ...
- bad interpreter: Text file busy
刚才运行test_mysql.py文件的时候 报了个这样的错.上网查了下,链接在这里:http://www.cnblogs.com/kerrycode/p/4038934.html 于是我就把第一行的 ...
- 执行shell脚本时提示bad interpreter:No such file or directory的解决办法
执行shell脚本时提示bad interpreter:No such file or directory的解决办法 故障现象:在终端直接cd /var正常,在shell脚本中执行则报错.原因是脚本是 ...
- windows下建立文件的换行符^M导致linux下的shell脚本执行错误的解决方式
常常在windows下编辑的文件远程传送到linux下的时候每行末尾都会出现^M.这将导致shell脚本执行错误,主要是由于dos下的编辑器和linux下的编辑器对文件末行的回车符处理不一致导致. 主 ...
- 远程shell脚本执行工具类
/** * 远程shell脚本执行工具类 */public class RemoteShellExecutorUtils { private static final Logger logger = ...
- shell脚本执行错误 $'\r':command not found
shell脚本执行错误 $'\r':command not found Linux下有命令dos2unix 可以用一下命令测试 vi -b filename 我们只要输入dos2unix *.sh就可 ...
- 用java代码调用shell脚本执行sqoop将hive表中数据导出到mysql
1:创建shell脚本 touch sqoop_options.sh chmod 777 sqoop_options.sh 编辑文件 特地将执行map的个数设置为变量 测试 可以java代码传参数 ...
- 2.8 补充:shell脚本执行方法
bash shell 脚本的方法有多种,现在作个小结.假设我们编写好的shell脚本的文件名为hello.sh,文件位置在/data/shell目录中并已有执行权限. 方法一:切换到shell脚本 ...
随机推荐
- Python 事件
from multiprocessing import Process,Event e = Event() #创建事件对象,这个对象的初识状态为False print('e的状态是:',e.is_se ...
- j教你如何用erlang-tuple
元组是用来保存一组数据元素的复合数据类型,其中数据元素是要求为erlang的数据类型,单不一定要是相同的类型,元组使用封闭的花括号{}来定义,里面的元素有逗号隔开. 例如: 1> {1,2,3} ...
- js调用app启动页
第一步:添加js $(function () { var ua = window.navigator.userAgent.toLowerCase(); //微信 if(ua.match(/MicroM ...
- 多设备同时进行monkey抗压测试
adb工具操作monkey抗压测试. 首先得安装adb工具,且配置好环境配置.推荐链接: 安装方法:https://blog.csdn.net/L_201607/article/details/781 ...
- day07 深浅拷贝
今日概要 深浅拷贝(重点) 文件操作 详细内容 直接赋值: 直接将对象的引用赋值给另一个对象 v1=1000 v2=v1 #v1 v2指向同一个内存地址 print(id(v1),id(v2))#相等 ...
- 集群相关、用keepalived配置高可用集群
1.集群相关 2.keepalived相关 3.用keepalived配置高可用集群 安装:yum install keepalived -y 高可用,主要是针对于服务器硬件或服务器上的应用服务而 ...
- selenium 网络请求
selenium 网络请求 browser.find_element_by_id("id的name")browser.find_element("")brows ...
- 在干净的ubuntu 14.10上编译Qemu2.2.0的过程
下载Qemu的源代码 从官网http://wiki.qemu.org/Main_Page 中下载最新的源代码,目前是2.2.0. 安装依赖库和编译 编译过程分两步1. ./configure 2. m ...
- java 各种循环遍历
遍历方式选择: 实现了 RandomAccess 接口的 list,优先选择普通 for 循环 ,其次 foreach: 未实现 RandomAccess 接口的 list, 优先选择 iterato ...
- 计算:表中varchar类型的字段能容纳的最大字符数?
建表语句: CREATE TABLE `test2` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `content` varchar(21842) NOT ...