$ [$(id-u)-eq0]&&echo"the user is admin"
$ [$(id-u)-ne0]&&echo"the user is not admin"
$ [$(id-u)-eq0]&&echo"the user is admin"||echo"the user is not admin"
$ uid=`id-u`
$ test$uid-eq0&&echo this is admin
this is admin
$ [$(id-u)-ne0]||echo this is admin
this is admin
$ [$(id-u)-eq0]&&echo this is admin ||echo this is not admin
this is admin
$ su - stu1
[stu1@server ~]$ [$(id-u)-eq0]&&echo this is admin ||echo this is not admin
this is not admin
$ a=
$ test-z$a;echo$?
$ a=hello
$ test-z$a;echo$?
$ test-n$a;echo$?
$ test-n"$a";echo$?
$ [''=$a];echo$?
-bash: [: : unary operator expected
2
$ [[''=$a]];echo$?0
$ [1-eq0-a1-ne0];echo$?
$ [1-eq0&&1-ne0];echo$?
$ [[1-eq0&&1-ne0]];echo$?