All pastes #2066012 Raw Edit

Anonymous

public text v1 · immutable
#2066012 ·published 2011-05-20 21:51 UTC
rendered paste body
[ag@giggitybytes bin]$ ./getopt.sh -a one -b two -c three
Option A is ""
Option B is ""
Option C is ""
[ag@giggitybytes bin]$ cat getopt.sh 
#!/bin/bash
while getopts “ab:c:d:” OPTION
do
        case $OPTION in
a) optA="$OPTARG";;
b) optB="$OPTARG";;
c) optC="$OPTARG";; 
	esac
done

echo "Option A is \"$optA\""
echo "Option B is \"$optB\""
echo "Option C is \"$optC\""

[ag@giggitybytes bin]$