--- trunk/bin/log.sh 2008/12/01 23:39:39 664 +++ trunk/bin/log.sh 2008/12/02 01:15:21 669 @@ -1,4 +1,11 @@ #!/bin/sh -vi `ls -at var/log/*.log | head -3` +last_logs=`ls -at var/log/*.log | head -3` + +if [ ! -z "$1" ] ; then + grep "$*" $last_logs | vi -R - + exit +elif [ ! -z "$last_logs" ] ; then + vi $last_logs +fi