1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh word=$1 not=$2 flag=$3 temp=`mktemp` grep -i '^'"$word"'$' /usr/share/dict/words | grep -iv "['$not]" > "$temp" if [ "$flag" = '-l' ]; then cat "$temp" | tr 'A-Z' 'a-z' | sed 's/\(.\)/\1\n/'g | sort | uniq -c | sort -n else cat "$temp" fi rm "$temp"