#!/bin/bash
read -p "login name:" username
if [ $username = "ubuntu" ]; then
echo "Yes"
else
echo "./If.sh"
fi
exit
怎么让它循环起来
shell初学者求教
- LU开拓者
- 帖子: 59
- 注册时间: 2012-02-29 10:07
- tailsgao
- 帖子: 209
- 注册时间: 2010-07-09 7:37
Re: shell初学者求教
while read
....
done
....
done

- LU开拓者
- 帖子: 59
- 注册时间: 2012-02-29 10:07
Re: shell初学者求教
能详细点么 我新手 刚接触~
- Think1st
- 帖子: 45
- 注册时间: 2012-02-07 23:08
Re: shell初学者求教
tailsgao 写了:while read
....
done
代码: 全选
#!/bin/bash
while read -p "login name:" username
do
if [ $username = "ubuntu" ]; then
echo "Yes"
else
echo "./If.sh"
fi
done
在这里,问题比答案更抢手。
- LU开拓者
- 帖子: 59
- 注册时间: 2012-02-29 10:07
Re: shell初学者求教
谢谢!
能让它在输入ubuntu的情况下停止执行,而其它情况继续执行么

能让它在输入ubuntu的情况下停止执行,而其它情况继续执行么