Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Bash by bandicoot ( 17 years ago )
#this can resolve ./script -options_and_parameters
while getopts "hv123f:" OPT; do
    case "$OPT" in
        h)      echo -e $help_flag
                exit 0 ;;
        v)      echo -e "`basename $0` version 0.1
Script was written by Andrey Trofimov"
                exit 0;;
        f)      address=$OPTARG ;;
        1)      CCASE=1;;
        2)      CCASE=2;;
        3)      CCASE=3;;
        ?|*)     # getopts issues an error message
                echo "$USAGE";
                exit 1
                ;;
   esac

                if [ "$OPT" != -z -a "$address" = "" ]
                then
               echo "Enter your text and press CTRL+D to FINISH"
               fi
done
shift $(($OPTIND - 1))

 

Revise this Paste

Parent: 7317
Your Name: Code Language: