X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=fortune;h=5030086a99a0b895d088fe9afa4b923e0fedf232;hb=0bf2a588b518eeb613fdb2ad0fe23c23131497ac;hp=cd24a59c6cc0184ee71628eb3ab509dccd6cf3fe;hpb=bf2d32c6a8992ec463cc5f4b521fa58ebf8bbfdb;p=bin.git diff --git a/fortune b/fortune index cd24a59..5030086 100755 --- a/fortune +++ b/fortune @@ -17,31 +17,30 @@ a simple POSIX sh/awk implementation of fortune FILE="$(find /usr/share/fortune/ -type f -not -name '*.dat')" while [ "$1" != "" ]; do case $1 in - -h | --help) - usage - exit - ;; - -f | --file) - FILE=$2 - ;; - -c | --cookie) - FILE=/usr/share/fortune/$2 - ;; - -l | --list) - ls -1 /usr/share/fortune - exit - ;; - *) - echo "ERROR: unknown parameter \"$2\"" - usage - exit 1 - ;; + -h | --help) + usage + exit + ;; + -f | --file) + FILE=$2 + ;; + -c | --cookie) + FILE=/usr/share/fortune/$2 + ;; + -l | --list) + ls -1 /usr/share/fortune + exit + ;; + *) + echo "ERROR: unknown parameter \"$2\"" + usage + exit 1 + ;; esac shift 2 done -awk ' -BEGIN { +awk 'BEGIN { f++ }