This is a discussion on passing options to a shell script within the Shell scripting forums, part of the Development/Scripting category; Hi, im trying to write a script (on Solari that will accept two options out of a list of 5 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi,
im trying to write a script (on Solari that will accept two options out of a list of 5 options. The first set of options comprise --test, --real and -- verbose, the second set of options comprises --months and --year and of which each it takes a numerical variable greater than 0. What i am trying to accomplish is, when any one of the first set of variables is passed, a second from that set cannot be passed, and when an attempt to pass more than one option from the first set an error is given. the same applies to the second set of options. I am using getopts to get the options, but failed to find a way to restrict usage of only one option from the two sets of options. any guidance appreciated. Regards, Mike |
| Sponsored Links | ||
|
|
|
||||
|
You can see this script : http://www.cyberciti.biz/files/scrip...in-check-2.txt
It has example which will help you out |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SSH - Passing Unix login passwords through shell scripts | arulkumarr | Shell scripting | 4 | 08-27-2008 10:22 PM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 10-08-2007 01:36 AM |
| Certification options !!! | donovan | The Hangout | 14 | 05-30-2007 05:48 AM |
| Passing value from variable while its expected from keyboard | unix11 | Shell scripting | 3 | 02-22-2007 03:36 PM |
| How to verify the options used when mounting a nfs FS. | warren | Solaris/OpenSolaris | 4 | 03-28-2006 07:45 AM |