如题! 现象: 当时的场景是这样的:我在IDEA中编辑了项目中的脚本sh,然后利用maven打成zip包.把zip包上传到linux服务器解压运行. 当在linux服务器上运行该sh脚本文件时,提示错误:/bin/sh^M: bad interpreter: No such file or directory 原因: windows的换行符与linux的换行符是有区别的.我的IDEA使用了系统自带的换行符号(windows),所以在linux服务器上,该换行符就有问题了. 解决方法: IDEA的
注意:我启动的时候遇到脚本错误 » sh startup.sh -m standalone tanghuang@bogon : command not found : command not found : command not found: 'tartup.sh: line 19: syntax error near unexpected token `in 'tartup.sh: line 19: `case `uname` in 复制代码 这是因为在windows下编写的脚本文件,放到L
在从事软件开发的过程中,经常会涉及到在Linux下将数据库脚本文件从sh格式变为sql格式的问题.本文以一个实际的脚本文件为例,说明格式转换的过程. 1. sh文件内容 本文中的文件名为example.sh,其内容如下: #!/bin/bash function Init() { if [ -f"example.sql" ] then echo"example.sql is exits and is deleting it,then recreate it&qu