BASH: Script Input Flags - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

BASH: Script Input Flags

Hi. Im wondering if there is a way to use flags when starting a script.
Something like this.

[CODE]Script -a -b 10[/CODE]

Right now Ive got something like this.

[CODE]
while getopts ab AA
do case $AA in
a) var="value"
;;
esac
done
[/CODE]

So with that code I can only use flags ( -a -b ). Can I do the -b 10 so it will store say varB=10?


Sign In or Register to comment.