if [ $UID -ne 0 ]; then echo "Superuser privileges are required to run this script." echo "e.g. \\"sudo $0\\"" exit 1fi#该片段来自于http://www.codesnippet.cn/detail/040920135637.html
来源: http://www.codesnippet.cn/detail/040920135637.html