把系统升级了之后(有的时候更新系统也许也会遇到),发现使用shell,运行时会有报错:Syntax error: Bad for loop variable。仔细查看语法,并没有问题。后来才知道原因: 代码对于标准bash而言没有错,因为Ubuntu为了加快开机速度,用dash代替了传统的bash,是dash在捣鬼。 解决方法是取消dash: sudo dpkg-reconfigure dash 在选择项中选No,即可。
今天早上ubuntu下写了一段脚本,往数据库里批量插入数据,结果Bad for loop variable; 在网上查阅解决方案,找到了解决方案。如下: 解决方案: sudo dpkg-reconfigure dash 选择NO。 然后能正常运行了
当然如果本论坛只接受bug报告,不接受fecshop有关的交流我不说什么 Fecmall•#4•6年前 0 个赞 你这样写,别人能看懂吗?你自己清空一下自己大脑,你自己能看懂不? 1.你执行什么操作?什么步骤?发生了什么报错?你至少得把你的报错信息贴到标题里面把? 2.带来了什么问题?问题的原因是什么? 3.按照什么方式...
错误为Syntax error: Bad for loop variable 解决办法: sudo dpkg-reconfigure dash 在选择项中选No 从ubuntu 6.10 开始,ubuntu 就将先前默认的bash shell 更换成了dash shell;其表现为 /bin/sh 链接倒了/bin/dash而不是传统的/bin/bash。 ubuntu edgy是第一个将dash作为默认shell来发行的版本,这似乎是受了de...
写shell脚本时碰到了这样的一个问题,脚本中一个循环语句采用了类C风格的for循环,结构如下 for ((i=1;i<=20;i++)) do ... ... done 但在本人ubuntu10.04的机器上运行此脚本会出现如下错误。 ./t.sh: 2: Syntax error: Bad for loop variable ...
test04_for.sh: 3: Syntax error: Bad for loop variable 百度了下网上,解决方法: 在终端中输入: sudo dpkg-reconfigure dash 然后出现的界面中选择 NO 然后就能正确运行了。 *** Crontab中的除号(slash)到底怎么用? crontab 是Linux中配置定时任务的...
Static IP or reserved DHCP IP for the cache server. Ubuntu desktops configured to use the cache. Step 1: Installapt-cacher-ngon the Server sudo apt update sudo apt install apt-cacher-ng Once installed, the service starts automatically. You can check its status with: ...
for (( i = 1; i <= 100;i = i+1 )) do s=s+i done echo "The count is ==> $s" 使用第二种方法执行时出现 : test04_for.sh: 1: declare: not found test04_for.sh: 3: Syntax error: Bad for loop variable 解决方法: 在终端中输入: sudo dpkg-reconfigure dash 然后出现的...
Unpacking raid-web-console-2 (from raid-web-console-2_8.05-5_all.deb) ...Installing...Setting up raid-web-console-2 (8.05-5) .../home/joe/WebConsole/home/joe/WebConsole/home/joe/WebConsole/etc/init.d/vivaldiframeworkd: 26: Syntax error: Bad for loop variableStarting M...
syntax error: Bad for loop variable 其他 在ubuntu下跑一个测试脚本,提示for 循环的语法错误,查了一下,系统启动问题。 代码对于标准bash而言没有错,因为Ubuntu为了加快开机速度,用dash代替了传统的bash,是dash在捣鬼。 解决方法是 取消dash sudo dpkg-reconfigure dash 在选择项中选No,即可。 dash 好像是Debian的...