BBS水木清华站∶精华区

发信人: scaner (木瓜好好), 信区: Linux        
标  题: Re: Shell 编程问题求救 (转载) 
发信站: BBS 水木清华站 (Fri Mar 26 18:17:42 1999) 
 
 
可能是怕$1是空的,采这样做的, 
因为如果$1是孔的 
[ $1 != "" ]就成了 [ != "" ] 
不过觉得正确的用法是 [ -n "$1" ]才对吧 
 
【 在 cyberman (游荡的幽灵) 的大作中提到: 】 
∶ 【 以下文字转载自 Programming 讨论区 】 
∶ 【 原文由 cyberman 所发表 】 
∶ while [x$1 != x];do case $1 in 
∶       --help) 
∶         cat <<EOF 
∶  Usage:configure [options] 
∶          --help     show this message 
∶          --debug    Enable debuggin 
∶   EOF 
∶       exit 0;; 
∶      --debug) DEBUG = 1;; 
∶      *) echo "Unrecoginezed option:$1;exit 1; 
∶  esac 
∶  shift 
∶  done  
∶ 我不明白 [x$1 != x]  是什么意思 
 
 
-- 
#telnet I.want.to.go 
telnet: Unable to connect to remote host: No Route to host 
 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: dial6.nuaa.edu.] 

BBS水木清华站∶精华区