摘要: 将expect加入到shell脚本后 set 定义的变量会失效; 解决办法 : 将变量提到expect之外定义 #!/bin/bash . /etc/profile. ~/.bash_profileipnum=`ifconfig|grep addr|grep xxxx |wc -l`if [ $ip 阅读全文
posted @ 2017-03-03 16:04 XavierLee 阅读(4088) 评论(1) 推荐(0) 编辑
摘要: 在非root用户下 写了一个shell脚本 通过手动执行shell脚本 sh -x script.sh 可以正常输出 当把该脚本加入到crontab中后 定时任务有调用.但不会输入结果 需要在脚本中增加。 #!/bin/bash . /etc/profile. ~/.bash_profile 在SU 阅读全文
posted @ 2017-03-03 15:56 XavierLee 阅读(1307) 评论(0) 推荐(0) 编辑