shell脚本
废人一枚
闭关修炼
展开
-
shell脚本中调用(c程序,shell函数,shell命令)获取程序返回值
=================================1、shell脚本中调用shell脚本中的函数,获取shell函数调用的返回值:#!/bin/sh enjoy() { 。。。} res=en...原创 2019-08-29 00:29:54 · 11512 阅读 · 0 评论 -
shell脚本判断程序是否退出
#!/bin/shcd /root/my_exe/**PIDS=`ps |grep ./my_Scheduler |grep -v grep |awk '{print $2}'`**if [ $PIDS != " " ]; then echo "##############################################" echo "m...原创 2019-08-29 22:16:45 · 2832 阅读 · 0 评论 -
linux 删除指定时间之前的文件shell脚本
linux运行的系统中长时间运行可能会产生大量的日志文件或其它文件,如果不定时删除,会影响系统的某些功能,下面是通过crontab定时执行删除脚本来实现:cat delbak.sh#!/bin/shlocation="/root/sqlbak/"find $location -mtime +30 -type f |xargs rm -ffind $1 -mtime +$2 -type...原创 2019-08-29 22:23:51 · 1598 阅读 · 0 评论