2015年8月17日 星期一

[Bash] One line command have if else


id=`ls /sys/class/net | grep wan0`; if [ $id != "" ]; then echo 1 > /tmp/a; echo $id; else echo 0 > /tmp/a;  echo $id; fi 

Reference:

0 意見:

張貼留言