[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:
Run mult…Read More
[Bash] Kill the current PID# Kill the current PID
ABC=`ps|grep watchdog_rt|grep -v grep|cut -c 1-5`
if [ -n "$ABC" ]; then
kill -9 $ABC ; \
fi
…Read More
0 意見:
張貼留言