select app from the menu:
ABC
DEF
GHI
JKL
ALL # ALL will select all the apps in the menu
echo "Enter your option"
read option;
if [ ${option} = "ALL" ]
then
<execute the below command>
elif [ ${option} = "option" ] # option is the 1 selection from menu...not ALL
<execute the below command>
else
echo wrong option.""
fi
Question: how can i make that input (ALL) is taken as case sensitive.
i don't want to write permutation and combination using or gate(||).
i don't want to declare one mare variable and translate the input and he new Variable.
if i use ALL,all,All,aLl,alL.........it should consider it as input.
Thank you in Advance!
Thank you for your reply. i have updated the thread. you are correct, when that is case with yes & no it works.... when the parameter changes as i updated the thread. i will use [Aa][Ll][Ll] ..... but it will not work as expected.
Hi Junior-helper;
tried the code, but didnt help.
error message:
: : bad substitution
Hi Sea,
i cant use select , because 1) Applications vary on servers. 2) in later part if we add one more app... again i need to modify the select code line. if we copy the script to other Machine againi need to modify the select line. just to avoid it... i have used command....
"ls -lrt <Path where app folders will be present> | grep -v total | awk '{print $9}' > $FilePath/FIle.txt"...... now the menu will be displyed from FIle.txt......
cat FIle.txt
ALL
What's your shell?
Is it possible that your shell is *not* bash ? Or rather old bash?
It works for me in bash, but dash will complain about bad substitution.
The 1st option worked.....but i should use it before i read a Variable
typeset -l option
read option;
i have one more confusion, i want to avoid special characters in if loop...below is the syntax.....but i want to know is there any other where i can eliminate all Special chars with out using below format.