Alex Rivera | Logout

bash script parameters

Asked 2009-05-06T02:52:19.937
14

I need to write a bash script, and would like it to parse unordered parameters of the format:

scriptname --param1 <string> --param2 <string> --param3 <date>

Is there a simple way to accomplish this, or am I pretty much stuck with $1, $2, $3?

Edit
Report

1 Answer

2

A nice example of how to implement short & long switches side by side is mcurl:

http://www.goforlinux.de/scripts/mcurl/

answered 2009-05-07T10:00:22.677

Your Answer