The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: help in getopts
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-04-2006
problems problems is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 7
help in getopts

hey

need help with getopts again.

i am using getopts to read my command line options and arguments. i can manage to do for options that have only one argument

e.g srcipt_name -f 3


i am able to use getopts to do this but i am having problems two accept more than two agruments
e.g. script_name -d joe 2005

i am having problems capturing the second argument. i can only capture joe using OPTARG but i cant capture 2005. i need to capture the two arguments for option d. pls need help

thanx alot