shell总结【第三篇】:shell脚本小技巧
1、脚本包含密码或者主机信息,执行完成以后自动删除脚本
rm -f `pwd $(dirname $0)`/$0
2、检查当前用户
# Check if user is root if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use root to install lnmp" exit 1 fi
出处:http://www.cnblogs.com/madsnotes/
声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。