Hello,

i am using ksh93 version         sh (AT&T Research) 1993-12-28 s

and have a problem with getopts and numeric values.

When i give an option the numeric value 16177 the variable will be set to 1.

for Example i am using the folling script
#!/usr/local/bin/ksh93-cpl

USAGE=$"
[+NAME?name]
[n:number?number.]#[number]
"

while getopts -a "${_CMD}" "${USAGE}" OPT
do
       case ${OPT} in
               n) number="${OPTARG}" ;;
       esac
done
shift $(($OPTIND - 1))

echo "${number}"

*Output:*
[EMAIL PROTECTED] ./getopts_test.sh -n 90000000
90000000

BUT when i set -n to 16177 i am getting the follwing back:
[EMAIL PROTECTED] ./getopts_test.sh -n 16177
1

Here is the script in debug mode:
ksh93-cpl -x ./getopts_test.sh -n 16177
+ USAGE=$'\n[+NAME?name]\n[n:number?number.]#[number]\n'
+ getopts -a '' $'\n[+NAME?name]\n[n:number?number.]#[number]\n' OPT
+ number=1
+ getopts -a '' $'\n[+NAME?name]\n[n:number?number.]#[number]\n' OPT
+ shift 2
+ echo 1

I have the same problem with last ksh93
version         sh (AT&T Research) 93s+ 2008-01-31

Why will does getopt change the Value 16177 to 1. This appears only with the number 16177

King regards from Munich...

Chris

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to