The UNIX and Linux Forums  

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 -->
  #2 (permalink)  
Old 03-25-2005
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
You could do it a couple ways, one - by adding a checksum count to each case. At the end of the getsopts statement and before any other code is executed, check to see if the checksum value is what is expected. If you dont like this approach, take the easy way and evaluate $#. $# holds a count of the number of command line arguments passed to the script.