![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| how to? launch command with string of command line options | TinCanFury | Shell Programming and Scripting | 5 | 04-28-2008 06:06 PM |
| How to hold string array in shell scripts | brajesh | Shell Programming and Scripting | 3 | 03-27-2007 09:14 AM |
| Adding -options to shell scripts | sysera | Shell Programming and Scripting | 4 | 06-21-2005 10:56 AM |
| cat and wc options | Laura01 | Shell Programming and Scripting | 1 | 09-08-2002 11:21 PM |
| cp options | milage | UNIX for Dummies Questions & Answers | 3 | 07-13-2001 12:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Scripts that take String options
I need help to know how to create a script that takes string options and not only 1 charecter.
I wanted to make a script that takes 'string' options eg. hscript.sh -product XXX -version XXX I know that I can make a script that takes "1 Charecter " options eg. hscript.sh -m XXX -l XXX -s XXX , with a function called "getopts". When i tried to use "getopts" to make the options as a string and not only 1charecter the script didn't work. |
|
|||||
|
Hi.
I think Ygor's suggestion is relatively easy to implement and useful to know about. However, there are those extra actions with which getopts-like facilities can help us -- error messages, shifting, etc. There is a shell version of getopt that can process long options. See Bash long options and Python s-expression parser for details ... cheers, drl Last edited by drl; 10-19-2007 at 08:09 AM.. Reason: Clarify meaning. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|