Problem with Input parameters

Hi,

I am facing a weird problem with input parameters. Please find more details about my problem below:

a) I am executing a korn shellscript with 11 input parameters from "Appworx" tool (it's a scheduling tool) and immediately displaying those 11 parameter values in unixscript and noticed that, first 9 parameters its displaying fine, but for 10th and 11th parameters its displaying like:

firstparameter+appended numerical value 0, firstparameter+appended numberical value1.

Could you please let me know why its taking 10th and 11th parameters weirdly? Your help will be highly appreciated.

Thanks,
Praveen

Hi.

Try using { } around your input parameters:

i.e.

$ cat Test
echo $10

$ ./Test a b c d e f g h i j k l m n
a0

$ cat T
echo ${10}

$ ./Test a b c d e f g h i j k l m n
j

This may not help much as far as Appworx goes but it should help with parameters (arguments).

insert this into a shell script, then use it with your 10 parameters.

#!/bin/ksh
cmd=`echo $*`
echo "Command Line: $cmd"
echo "\$1 = First Parameter: \"$1\""
echo "\$2 = First Parameter: \"$2\""
echo "You get the idea." 
echo "\$* = Parameters: $*"
echo "\$# = Number of Parameter: $#"
echo

Hi Scott,

It's Worked. Appreciated your help!

Thanks,
Praveen

The best way would to use the powerful getopts : Linux tip: Bash parameters and parameter expansions