The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-05-2009
tostay2003 tostay2003 is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 23
here is how you do it,

a,b,c are the command line options

Code:
while
      getopts a:b:c: OPT 2>/dev/null
   do
      case $OPT in
         a)
            VarA=$OPTARG
         ;;
         b)
            VarB=$OPTARG
         ;;
         c) 
            VarC=$OPTARG
         ;;
         *)
            help #Call help function
         ;;
      esac
   done