Linux Mint中写了一个简单的shell脚本,利用for..do..done结构计算1+2+3......+100的值,结果执行"sh -n xxx.sh"检测语法时总是报错,但在PC机上可正常运行: 脚本: #!/bin/bash #information PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH read -p "Please input a…
在linux下写了一个简单的shell,循环10次. test.sh #!/bin/bash ## ##循环10次 ## ; i<; i++)); do echo Good Morning ,this is $i shell program. done 执行:sh test.sh 报下面的错误. Syntax error: Bad for loop variable 在网上搜索了一下. 因为Ubuntu为了加快开机速度,用dash代替了传统的bash,所以我们这样执行就没问题. bash tes…
执行脚本报错 #!/bin/bash s=0 for (( i=1; i<=100; i++ )) do s=$(( $s + $i )) done echo $s sh add.sh 报错: add.sh: 4: Syntax error: Bad for loop variable 代码没有错误,Ubuntu为了加快开机速度,用dash取代bash. 解决的方法:取消dash,使用bash: sudo dpkg-reconfigure dash 选择No选项.…
Eclipse 出现Some sites could not be found.  See the error log for more detail.错误 解决方法 Some sites could not be found.  See the error log for more detail.这话的意思是在设置的update的sites有问题,问题是无法发现或找到该site.这是因为我们在使用eclipse的help-->install new software的时候,添加安装路径有时会发…
执行shell脚本的时候,提示如下错误: 查询资料后发现: 执行: vi finddir.sh 然后,输入 :set ff 结果是: 解决方案就是,修改为unix: :set ff=unix 执行保存命令: :wq 再次执行: :set ff 最后执行命令. 本文中有一处错误,那就是脚本中的 if [-d "$folder"]; then 改为: if [ ! -d "$folder" ]; then 亲测好使.…
Syntax error, insert "}" to complete ClassBody 报该错误是因为我从网页上粘贴了别人的代码,并没有发现什么异常但还是编译器报红叉. 解决方法:把报错代码完整粘贴到新建项目中,或者手输源码,问题解决!…
从 ubuntu 6.10 开始,ubuntu 就将先前默认的bash shell 更换成了dash shell:其表现为 /bin/sh 链接倒了/bin/dash而不是传统的/bin/bash. ubuntu edgy是第一个将dash作为默认shell来发行的版本,这似乎是受了debian的影响.wiki 里面有官方的解释,https://wiki.ubuntu.com/DashAsBinSh,主要原因是dash更小,运行更快,还与POSIX兼容. 但目前存在的问题是,由于shell的更换…
这个错误是:表处于"装入暂挂"状态. 经多次尝试 总结方法: 1:reorg table <表>: 假如不好使 则下面方法 2,先前尝试装入(LOAD)此表失败.表的状态应该是load pending; 你可以执行一下db2 "load query table <tabname>"命令来查看你的表状态. 然后用db2 "load from /dev/null of del terminate into <tabname>…
Windows: 将opencv安装目录下的cv2.pyd拷贝到Python安装目录里Lib中site-packages Linux: (1)将opencv安装目录下的cv2.so拷贝到Python安装目录里Lib中site-packages (2) 尝试输入以下指令: sudo apt-get install python-opencv…
今天调试有个linux环境的应用时,gdb提示A syntax error in expression, near `variable)'.,最后经查,gdb版本过低(比如7.2)或者源代码不匹配所致,确保源代码匹配,gdb在gcc之后发布,问题解决.…