#!/bin/bash
if ! grep "^#!" $1 &>/dev/null; then
cat >> $1 << EOF
#!/bin/bash
# Author:
#Date & Time:'date +"%F %T"'
#Description:
EOF
fi
vim +5 $1
2.任意三个整数,判断最大数
#!/bin/bash
echo "please enter three number:"
read -p "the first number is:" n1
read -p "the second number is:" n2
read -p "the third number is:" n3
let MAX=$n1
if [ $n2 -ge $n1 ]; then
MAX=$n2
fi
if [ $n3 -ge $MAX ]; then
MAX=$n3
fi
echo "the max number is $MAX."