Passing arguments to shell script like perl script get-opts
Hi,
I was trying to pass arguments to shell script in such a way that perl script get-opts behaves. Example: Present Shell: sh shell.sh arg1 arg2 arg3 perl perl.pl --arg2=2 --arg1=1 --arg3=3 I think you got my point In shell script we need to give them in order with out knowing the significance of the argument, where as in perl we can give in any order by some identification. This is what i need the same is in shell script. Please help. |
|
The shell builtin command getopts does what you want. There's a tutorial on the Bash Hackers Wiki.
|
All times are GMT -5. The time now is 02:14 PM. |