Indeed sh is not the right shell to use, unless the script is only using sh syntax, which is not the case here, since your script sample is using bash syntax.
Got that. Also while I was trying the read command it works well for almost all characters including ?. But it didn't work for *. It showed the list of files in the current directory. Can you please help me understand that?
If you do not use those double quotes, then if the variable contains an asterisk, then this will be expanded by the shell to all files in the current directory..
Hi RudiC,
During the UT phase, I have a manual run on the script. Once success, I will be passing parameters obtained from another script to call this one. I am going to use the case statement in this one.
So this script will be called indirectly from another script that in turn will be called from a cron.
So now as Scrutinizer mentioned I will now call the main script through bash / rather then sh /
Regards,
Nss280