| Click Link Linux Install Manual | Install guide - How to install linux install manual faq linux serwer install ? | Click Link Linux Start | Internet Security , Linux porting guide , block forward ports - Linux manage guide network administrator Online manual security | Click Link Online Community | Guide to managing media in linux community online internet linux community linux on-line manual free online guide | Click Link Free Linux E-Book | Linux from scratch manual free e-book linux e-book e-book download linux security internet security | Click Link Free Online Guide | Guide to managing media in linux community online internet linux community linux on-line manual free online guide |
For tests, the [[ ]] construct may be more appropriate than [ ]. Likewise, arithmetic comparisons might benefit from the (( )) construct.
a=8 # All of the comparisons below are equivalent. test "$a" -lt 16 && echo "yes, $a < 16" # "and list" /bin/test "$a" -lt 16 && echo "yes, $a < 16" [ "$a" -lt 16 ] && echo "yes, $a < 16" [[ $a -lt 16 ]] && echo "yes, $a < 16" # Quoting variables within (( a < 16 )) && echo "yes, $a < 16" # [[ ]] and (( )) not necessary. city="New York" # Again, all of the comparisons below are equivalent. test "$city" \< Paris && echo "Yes, Paris is greater than $city" # Greater ASCII order. /bin/test "$city" \< Paris && echo "Yes, Paris is greater than $city" [ "$city" \< Paris ] && echo "Yes, Paris is greater than $city" [[ $city < Paris ]] && echo "Yes, Paris is greater than $city" # Need not quote $city. # Thank you, S.C. |