i want automated script

echo "Enter your choice :\c"
read num
case $num in .
1)"${TEST_HOME}"/ctrl_extract.ksh 1 ;;
2)"${TEST_HOME}"/ctrl_extract.ksh 2 ;;3)"${TEST_HOME}"/ctrl_extract.ksh 3 ;;
4)"${TEST_HOME}"/ctrl_extract.ksh 4 ;;
5)"${TEST_HOME}"/ctrl_extract.ksh 5 ;;
.........................................................
.............................................................
...............................................................
this is my script-i hv number of cases.so i dont want writing case just like above..i want a single line script between case block so that writing 100 cases is not required.

Please post your script with the code tags.
Use test if you don't want to write 100 case statements.

echo "Enter your choice :\c"
read num
if [ $num -gt 0 -a $num -lt 101 ]; then "${TEST_HOME}"/ctrl_extract.ksh $num; fi

Just a refinement in the above script

echo "Enter your choice :\c"
read num
#if [ $num -gt 0 -a $num -lt 101 ]; then ->Can remove this if not needed
"${TEST_HOME}"/ctrl_extract.ksh $num;
#fi

Hope there is no restriction in the number that the user mentions.


if [ "$#" -gt 0 -a "$1" -gt 0 -a "$1" -lt 100 ]
then
              "${TEST_HOME}"/ctrl_extract.ksh $1;
fi