标签:
[dehua@teacher ~]$ [ "$(id -u)" -eq "0" ] && echo you are root || echo you must be root
you must be root
[dehua@teacher ~]$ id -u
501
==========================
&& 与符号
|| 或符号
&&如果前面的命令执行成功则执行&&后的命令否则执行||后面的命令
标签:
原文地址:http://www.cnblogs.com/blog-acf/p/4265670.html