Linux / UNIX Tech Support Forum
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 Solaris) that will accept two options out of a list of 5 ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
im trying to write a script (on Solaris) 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
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to verify the options used when mounting a nfs FS. | warren | Solaris/OpenSolaris | 5 | 30-04-2009 05:56 PM |
| SSH - Passing Unix login passwords through shell scripts | arulkumarr | Shell scripting | 4 | 27-08-2008 09:22 PM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 08-10-2007 12:36 AM |
| Certification options !!! | donovan | The Hangout | 14 | 30-05-2007 04:48 AM |
| Passing value from variable while its expected from keyboard | unix11 | Shell scripting | 3 | 22-02-2007 02:36 PM |