Article 54A2R Can someone please help me in clearing logic in case/esac statement?

Can someone please help me in clearing logic in case/esac statement?

by
blason
from LinuxQuestions.org on (#54A2R)
Hi All,

I am trying to write a script however stuck in my below issue and can someone please help me clearing my logic, pls?

I wanted to pass $1 and $2 flag with my script and need to take action accordingly

Here is my usage:
Quote:
if [ $# -lt 3 ];then
echo "Usage: $0 <command> <zones>"
echo "command: "
echo " -u : Update All Enabled Zones"
echo " -l : list zones"
echo " -i : Individual Update zones"
echo ""
echo "Zone names"
echo " E.g. $0 -u all | $0 -i shopping"
echo ""
exit 0
fi
now my command would be
Quote:
update -u all
update -i shopping
So I can write for $1 which is -u using case/esac but then I am sorry I have no clue about all | shopping parameter in $2.
How do I pass that?

TIAlatest?d=yIl2AUoC8zA latest?i=DnVUdgitnwI:BrxcNd15v8w:F7zBnMy latest?i=DnVUdgitnwI:BrxcNd15v8w:V_sGLiP latest?d=qj6IDK7rITs latest?i=DnVUdgitnwI:BrxcNd15v8w:gIN9vFwDnVUdgitnwI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments