How can pass both an optional flag and unrelated required parameter to a bash script?
How I can pass both an optional flag and unrelated required parameter to a bash script?
Example, a user can type in: Code:
./myscript.sh -f myname Code:
./myscript.sh myname I can make $2 myname, but since the -f is optional, that will be $1 sometimes and there won't be a $2. What is the best way to do this? TIA |
|
Needed to use shift, thx
|
All times are GMT -5. The time now is 08:44 AM. |