cancel
Showing results for 
Search instead for 
Did you mean: 

getopts

Waqar Razi
Regular Advisor

getopts

I want to write a script to do the over the network ignite backups. What I want to do is the script checks if we supply options like -s, -a, -n through command line, if yes it uses them and if not, it uses the default values.

I have done that by passing command line arguments but my manager doesnt want that. He wants to use the same option indicators as the original make_net_recovery commad. This way the input parameters don’t have to be in any required sequence.

I just came to know it can be done with getopts, can some one please help me in writing the script?
2 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: getopts

Hi Wagar:

There is an example script in the manpages that should get you going:

http://docs.hp.com/en/B2355-60130/getopts.1.html

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: getopts

It would have been better to continue your related questions in your previous thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1317575