判断当前用户是否为root
#!/bin/bash# date:2018/12/16###1.利用$()的命令替换if [ "$(whoami)" == "root" ]then echo "root";fi# [ 是保留字符,两边要加空格!if [ "`whoami`" == "roo