home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3488 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  864 b 

  1. Path: sparky!uunet!mcsun!sun4nl!orcenl!rgasch
  2. From: rgasch@nl.oracle.com (Robert Gasch)
  3. Newsgroups: comp.unix.shell
  4. Subject: Parameter Passing
  5. Message-ID: <2676@nlsun1.oracle.nl>
  6. Date: 14 Aug 92 13:48:48 GMT
  7. Organization: Oracle Europe
  8. Lines: 18
  9.  
  10. I have written a shell script which accepts one parameter. The first
  11. thing it does after making sure that it is /bin/sh and not some
  12. other shell is check if the parameters are OK.
  13. If I call it as
  14.     ap STRING_ARG
  15.     sh ap STRING_ARG
  16. everything is fine. The parameter is recognized and life is great.
  17.  
  18. Here comes the confusion: As soon as I call it as
  19.     . ap STRING_ARG
  20. the parameter is not recognized anymore. Even supplying it with 
  21. 2 or more parameters does not change the fact that $# is equal to 0. 
  22.  
  23. Could some kind soul out there explain what is going on and why
  24. I get these strange reactions.
  25.  
  26. Thanks a lot
  27. --> Rob
  28.