I Would like to try to condense The if statements down below Basically Shrinking the Code Down an any way possible I have this pulling from a File in order to get the data and thats in the code but as it stands can I Shrink my code?
if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "E" ];then echo "Class: Extra" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "G" ];then echo "Class: General" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "A" ];then echo "Class: Advanced" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "P" ];then echo "Class: Tech Plus" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "N" ];then echo "Class: Novice" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" == "T" ];then echo "Class: Tech" else if [ "$(LC_ALL=C grep -w $CsT l_amat/AM.dat | awk -F '|' '{print $6}')" != "T" ];then echo "Class: Unknown" fi fi fi fi fi fi
Aucun commentaire:
Enregistrer un commentaire