help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getopt question


From: Jonas Geiregat
Subject: getopt question
Date: 27 Feb 2005 10:47:43 -0800

Hi 
I'm writting a bash script that support commandline arguments.

args=`getopt b:i: $*`
set -- $args
for i
do
case $i in
-b) echo "It should print the option parameter but it doesn't: $1";;
-i) echo "It should print the option parameter but it doesn't: $1";;
esac
done

$1 is never the optional parameter I run the script as followed
script -b param -i param
or script -bi param param
in both cases $1 is -b


reply via email to

[Prev in Thread] Current Thread [Next in Thread]