shell
c4en241q10n9
喜欢这行,但也很迷茫。
展开
-
shell脚本 实用集合 - 持续更新,欢迎补充
1. 判断没有文件夹就创建 if [ ! -d "$path" ]; then mkdir -p $path fi原创 2020-12-18 11:19:50 · 235 阅读 · 0 评论 -
shell脚本踩坑一
这种坑出现再什么情况? python,ruby,java等 远程登录到服务器上,执行shell脚本时。 你会发现,python,ruby等远程登录执行时,脚本中的有的命令始终不会生效,但是通过终端接入,手动执行该脚本,脚本中的命令又是正常的。 比如:shell片段 while read line do #统计进程的数量 count=`ps aux | grep $line | grep -v grep | wc -l` if [[ $count -gt 0 ]];then原创 2020-06-30 15:36:44 · 241 阅读 · 0 评论