一.crontab调度 对于linux 自带crontab而言, xxx.sh的一般编写格式以#!/bin/bash 解释器开头,可在脚本中加入: date 但是,shell脚本执行 需要 x权限,执行的方式如下: ./xxx.sh sh ./xxx.sh 其中,后缀.sh 第一行#!/bin/bash 没有,需要使用sh命令去执行 1.crontab简单调度 [root@localhost ~]# crontab -e no crontab for root - using an e
遍历目录下所有的文件是目录还是文件 for file in ./* do if test -f $file then echo $file 是文件 fi if test -d $file then echo $file 是目录 fi done filelist=`ls ./proto` echo $filelist for file in $filelist;do #不能有判断if [-f $file ] ,为什么?因为文件是在当前目录的proto目录下,我们filelist输出的是文件列表,没