1 #!/bin/sh 2 3 TODOFILE=minidist.txt 4 5 if [ "$1" = "" ]; then 6 OPT="-e @" 7 fi 8 9 while [ "$1" != "" ]; do 10 case "$1" in 11 -p) 12 OPT="$OPT -e %" 13 ;; 14 -t) 15 OPT="$OPT -e @" 16 ;; 17 -i) 18 OPT="$OPT -e \^" 19 ;; 20 -f) 21 OPT="$OPT -e #" 22 ;; 23 -h) 24 echo "Usage:" 25 echo "$0 [-p] [-t] [-f] [-h]" 26 echo -e " -p\tDisplay paritally completed commands" 27 echo -e " -t\tDisplay unstarted commands" 28 echo -e " -f\tDisplay fully completed commands" 29 echo -e " -i\tDisplay started but dsyfunctional commands" 30 echo -e " -h\tDisplay this help screen" 31 exit 32 ;; 33 esac 34 shift 35 done 36 if [ "$OPT" = "" ]; then 37 exit 38 fi 39 grep -v "\!" $TODOFILE | grep $OPT | cut -c 2-1000 | sort | cat -n |