标题:shell类c问题,求教
取消只看楼主
明明白白
Rank: 2
等 级:论坛游民
帖 子:57
专家分:61
注 册:2012-3-19
结帖率:83.33%
已结贴  问题点数:5 回复次数:0 
shell类c问题,求教
#!/bin/bash
i=0
(
        while (( i < 3 ))
        do
                echo hello
                i=`expr $i + 1`
                sleep 1
        done
        echo "i=$i"
)
echo "i=$i"

文件名:test1.sh
dangming@dangming-desktop:~/user/review/shell$ sh test1.sh
test1.sh: 12: cannot open 3: No such file
test1.sh: 12: i: not found
i=0
i=0
不知道错在哪里,我的ubuntu是这个结果,别人的redhat、ubu可以执行



     
搜索更多相关主题的帖子: hello cannot ubuntu redhat 
2012-09-03 23:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-380638-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.777382 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved