真是坑爹,就下面的sh,竟然也写了很久! if [ `pwd` != '/usr/xx/bin/tomcat' ] then echo "rstall is not allowed in current dir : `pwd` !" return fi ./bin/rstmst.sh;../tomcat-bb/bin/rstns.sh if 的语法真麻烦, linux if 的语法真是服了! if 后面跟的是 [] , 而不是 () 擦! if 和 then 之间必须换行! ———
http://linux.about.com/library/cmd/blcmdl1_sh.htm http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html Linux / Unix Command: shCommand LibraryNAMEbash - GNU Bourne-Again SHell SYNOPSISbash [options] [file] DESCRIPTIONBash is an sh
same issue i faced , tried with ./unstack.sh and ./clean.sh also but couldn't fix the issue.Following step helped me to resolve this issue../unstack.sh./clean.sh rm -rf devstack folder reboot system cloned devstack codecd devstack./stack.sh ref: http
[root@testdb11b dev]# /u01/app//grid/root.sh Performing root user operation for Oracle 11g The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /u01/app//grid Enter the full pathname of the local bin directory: [/usr/local/
问题:bin/sh^M: bad interpreter: No such file or directory 原因:.sh脚本在windows系统下用记事本文件编写的.不同系统的编码格式引起的. 解决方法:修改.sh文件格式 (1)使用vi工具 vi test.sh (2)利用如下命令查看文件格式 :set ff 或 :set fileformat 可以看到如下信息 fileformat=dos 或 fileformat
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息. 解决:1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行.转换方式如下(UltraEdit):File-->Conversions-->DO