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




Thread: getopts
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 03-26-2005
yerra yerra is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 13
I think I got it now.
If i provide scriptname -s schema -u user -d database, $# evaluates to 6 based on no of options and its values. (-s schema) 2, (-u user) 2 and (d database ) 2.

So if it is -d database -f it evaluates to 3 (-d database)2 and (-f) 1.
If he specifies -d database and -t ( That too evaluates to 3) .

How do i check if he has specified -t or -f then ?