一.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
同一脚本sh 脚本名 执行时报Syntax error: "(" unexpected:而./脚本名执行不报错,为什么呢 脚本内容如下: function usage(){ echo "usage:$0 url" exit } function check_url(){ -T $ ] then echo "$1 is ok" else echo "$1 is not ok " fi } function main(){ ] t