home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / utility / misc / gulam / examples / argc.g next >
Text File  |  1989-01-09  |  382b  |  27 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. # count the number of arguments ----------------------------------------------
  7. # example:        argc a b c
  8.  
  9. echo  '$0 ' $0
  10. echo  '$1 ' $1
  11. echo  '$2 ' $2
  12. echo  '$3 ' $3
  13. echo '-----'
  14.  
  15. set i 0
  16. foreach xx { $- }
  17.     set i $i + 1
  18. endfor
  19. echo '    --- ===' $i ' arguments === ---'
  20.  
  21. echo '-----'
  22. echo  '$0 ' $0
  23. echo  '$1 ' $1
  24. echo  '$2 ' $2
  25. echo  '$3 ' $3
  26. echo '-----'
  27.