参考如下脚本内容,自定义自动化备注工具 #!/bin/bash
if [ $# -ne 1 ] then echo "please enter a parameter" exit else newfile=$1 fi
if ! grep "^#\!" ${newfile} &> /dev/null then cat >>${newfile}<<EOF #!/bin/bash #Author:Insert Your Name here. #Date: `date +"%F %T"` EOF fi vim +3 ${newfile}
|