Easy commandline argument parsing in shell script
March 2, 2010 1 Comment
Here is a fairly easy method which can parse all input arguments passed to a shell script in commandline. This block of code can be either included in top of the script or source it from an external file.
Using this code within a shell script is very simple, just needs to define a global variable named ARGS_INPUT_FORMAT and set appropriate values to it. The argument parsing code will read this variable and set appropriate inputs as well as outputs.
Set values to the variable ARGS_INPUT_FORMAT as shown below.