I have a script like this:
read -e -r -p "enter name of product in CAPS: " ITEM
echo -e "Please enter the product number"
read -e -r -p "Enter list at date:" list
#Here someone enters case6 for ITEM
if [[ $ITEM == case6 ]]; then ITEMLST=`echo CASESIX`;fi
Then I have commands that look for the directory CASESIX and retrieves files: This command uses $ITEMLIST as the variable
after that I want to be able to ssh to case6:.
for i in `cat /tmp/productlist`; do su ncacct -c "ssh $ITEM /usr/query -m $i""" |
gawk '{if ($3 == "TLD") print "product '$i' is in truck"}';done
The problem is that I want the user to be able to enter either case6 or CASESIX and have the script go to the directory CASESIX which value "ITEMLST" holds.
Right now they must enter case6 and then the variable will get translated to CASESIX for the directory CASESIX. after that the ssh command will use "case6" as the value and ssh to the host case6
Is there a way to do this other than to make someone enter case6 for the read command? I would like if someone could enter case6 or CASESIX in that read command somehow and have the last command know that it should use case6 to ssh. Maybe it is not possible?