newscrips
#!/bin/bash
while getopts ":a:d:" SWITCH; do
case $SWITCH in
a) AUTHOR=$OPTARG
;;
d) DESCK=$OPTARG
;;
\?)
echo "unkown options"
exit 1
;;
esac
done
shift $[$OPTIND-1]
if ! grep "#!/bin/bash" $1 &> /dev/null; then
cat >> $1 << EOF
#!/bin/bash
#AUtor : ${AUTHOR:=gaohuina}
#date: `date +"%F"`
#DESC : $DESCK
EOF
fi
vim +5 $1
wait
chmod u+x $1