- 论坛徽章:
- 1
|
Hi, 请各位大虾帮忙看一下,为什么shell的数值比较会出现目录列表
i=0
v_len=3
if [ $i -lt ${v_len} ]; then
echo "hello"
fi
执行结果为
if [ $i -lt ${v_len} ]; then
>
anaconda-ks.cfg Desktop/ .gnome2_private/ .lesshst .scim/ .vnc/
.bash_history .dmrc grade.txt .metacity/ .ssh/ .Xauthority
.bash_logout .eggcups/ .gstreamer-0.10/ .mozilla/ .tcshrc .xsession-errors
.bash_profile .gconf/ .gtkrc-1.2-gnome2 .nautilus/ test.txt
.bashrc .gconfd/ .ICEauthority .python-eggs/ .thumbnails/
.chewing/ .gnome/ install.log .redhat/ .Trash/
.cshrc .gnome2/ install.log.syslog .rnd .viminfo
> echo "hello"
> fi
hello
我对shell不熟悉,请大虾指点一二,是否if [ $i -lt ${v_len} ]; then这个比较写法有问题?谢谢
|
|