#!/bin/bash # if [ -f $1 ];then echo "file already exist" && exit else touch $1 && chmod +x $1 fi cat>>$1<<EOF #!/bin/bash #Author: #Date & Time: `date +"%F %T"` EOF vim +5 $1
创建sh文件并加上x权限
原文地址:http://493689359.blog.51cto.com/4305089/1773090