随笔分类 -  shell scripts

shell脚本学习
摘要:crontab不能成功执行shell脚本的可能原因 1. crond进程不存在,该进程是crontab的守护进程,它必须存在才能让crontab正常使用; 2. 系统时间不对; 3. 环境变量的问题:crontab执行脚本的时候不会读取用户的环境变量等配置,所以可能很多命令不能使用导致脚本执行失败; 阅读全文
posted @ 2018-01-12 15:55 Achxku 阅读(377) 评论(0) 推荐(0)
摘要:高级bash脚本编程指南 http://www.tldp.org/LDP/abs/html/ 阅读全文
posted @ 2017-09-17 20:56 Achxku 阅读(134) 评论(0) 推荐(0)
摘要:方法1:使用bc工具,把结果printf格式化 res=$(printf "%.5f" ) echo $res 0.33333 ab= echo $ab 0.33333 ``` 阅读全文
posted @ 2017-09-14 17:07 Achxku 阅读(275) 评论(0) 推荐(0)
摘要:方法一: 方法二“” ifconfig eth1|grep Po "(? 阅读全文
posted @ 2017-09-05 18:48 Achxku 阅读(342) 评论(0) 推荐(0)
摘要:1、字符串判断 str1 = str2 当两个串有相同内容、长度时为真 str1 != str2 当串str1和str2不等时为真 n str1 当串的长度大于0时为真(串非空,变量) z str1 当串的长度为0时为真(空串) str1 当串str1为非空时为真 2、数字的判断 int1 eq i 阅读全文
posted @ 2017-09-05 16:17 Achxku 阅读(990) 评论(0) 推荐(0)