`

shell for略写形式 执行结果不对请大牛帮帮看???????

阅读更多
#! /bin/bash
for varible1 in {1..3}
#for varible1 in 1 2 3
do
echo "Hello, Welcome $varible1 times "
done

期望结果:

Hello, Welcome 1 times

Hello, Welcome 2 times

Hello, Welcome 3 times

实际结果:

Hello, Welcome {1..5} times

 

 

这是怎么回事????????????????????

求帮助!!!!!!!!!!!!!!!!!!!!!!!

 

0
6
分享到:
评论
1 楼 lkl 2015-01-17  
答案终于找到了
使用 sh 运行shell脚本出现上述问题
依据以下步骤可以解决
1.chmod a+x xxx.sh
2../xxxx.sh
原理上还未找到是怎么回事,这个还得有人讲解才行。我主要关注的是脚本能否按预期的运行。
  继续求解!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

相关推荐

Global site tag (gtag.js) - Google Analytics