![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using getopts | TurboArkhan | Shell Programming and Scripting | 3 | 06-22-2009 05:31 PM |
| getopts question | k2k | Shell Programming and Scripting | 2 | 06-26-2008 10:05 PM |
| getopts question!!! | andy2000 | Shell Programming and Scripting | 1 | 03-27-2007 01:15 AM |
| question about getopts | ahtat99 | Shell Programming and Scripting | 2 | 08-20-2006 02:45 PM |
| help in getopts | problems | Shell Programming and Scripting | 1 | 05-05-2006 12:07 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
getopts question
I am trying to set up prompts when you don't enter the right information or dont enter the information at all, when executing a script. Below is the question that i am asking and i am not sure how to set up the if statements to make sure that the user enters the name, cpu's, memory and ip. I was told that getopts with a cease statement might be usefull, but im not sure how to apply it. Any help would be greatly appreciated...
NAME=$1 NCPUS=$2 MEMORY=$3 IP=$4 MACHINENAME=`hostname` MASTERHOST=svvnyc702 echo "Do you wish to proceed with the creation of UAT ZONE zone-${NAME}, CPU's ${NCPUS}, MEMORY ${MEMORY}, IP ${IP} <y or n> ? \c" read WISH echo if [ $WISH = "n" ] ; then echo "You chose no, good bye" exit fi if [ ! $WISH = "y" ] ; then echo in vaild optin g - exiting exit fi |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|