Entering edit mode
23 months ago
genomics_buddy
•
0
Hi all,
I would like to create a small script for a particular detection and reporting but I can't reach my goal in bash, as a starter in shell scripting it is hard. Please correct or suggest it.
for i in VAR1 VAR2 VAR3 VAR4 VAR5 VAR6
do
if [ "$i" == "$varab" ]
then
VAR1="Haploid"
VAR2="Diploid"
VAR3="Triploid"
VAR4="Tetraploid"
VAR5="Pentaploid"
VAR6="Hexaploid"
echo "$i is the result"
break
else
echo "$i is not working"
fi
done;
varab
- can be anything from VAR1 to VAR6
In short, I need to find what is the variable among 6 and report it properly.