![]() |
|
|
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 |
| Help in getopts | chella | Shell Programming and Scripting | 4 | 11-02-2007 01:09 AM |
| getopts help | GrepMe | Shell Programming and Scripting | 3 | 06-20-2007 12:47 PM |
| help in getopts | problems | Shell Programming and Scripting | 1 | 05-05-2006 12:07 AM |
| getopts | Shell Programming and Scripting | 3 | 12-05-2002 07:42 PM | |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
using getopts
Hi, I have a program where I want to use getopts. I want to use "-i" option and then optionally supply arguments. If user dosent supply arguments, then also it should work. Please tell me how to proceed. Here is some code, this is not right code btw but a sample to understand what I want to do: Code:
while getopts :tui:c:p: swtch
do
case $swtch in
u) echo "Un-installing feature is under development.";;
i)
echo $OPTARG
if [[ $OPTARG = "" ]]
then
ValidateInput
else
ValidateInput ${OPTARG}
\?) usage ;;
esac
done
shift $(($OPTIND -1))
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|