|
发表于 2003-8-2 13:48:33
|
显示全部楼层
return value is not the same as stdout.
if condition catch the return value,not the stdout.
so,if ifconfig >/dev/null is best way.
Sorry, I still cann't input chinese.
kurt@OpenLab:~> true
kurt@OpenLab:~> false //<==see,no matter true or false,no output at all.
kurt@OpenLab:~> if true;then
> echo true
> fi
true //<== if condition passed!!!!
kurt@OpenLab:~> if false;then
> echo no true
> fi //<== see,no output,caz false return 0 to if condition.So if condition not passed.
kurt@OpenLab:~> |
|