SHELL-条件判断内建变量($UID)

[root@room9pc01 opt]# vim test1.sh

#!/bin/bash
#!/bin/bash

[ $UID != 0 ] &&  echo "your are not root" && exit
yum -y install vsftpd &> /dev/null
systemctl restart vsftpd
systemctl enable  vsftpd

你可能感兴趣的:(SHELL脚本)