|
Re: what is the difference between getopt, getopts, optarg [message #98633 is a reply to message #98631] |
Sun, 13 February 2005 20:17 |
Frank Naude
Messages: 4587 Registered: April 1998
|
Senior Member |
|
|
Hi,
Getopt and getopts are used for processing and
validating script arguments. Read the Unix man pages
for details:
GETOPT - is a Unix/Linux Command. "man getopt":
"getopt is used to break up (parse) options in
command lines for easy parsing by shell procedures,
and to check for legal options. It uses the GNU
getopt(3) routines to do this..."
GETOPTS is a shell built-in. "man bash" or "man ksh":
"getopts is used by shell procedures to parse
positional parameters...".
Study the man pages for more details and differences.
Best regards.
Frank
|
|
|