home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10015 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.7 KB

  1. Xref: sparky comp.unix.questions:10015 comp.unix.shell:3467 comp.sys.hp:9216
  2. Path: sparky!uunet!mcsun!Germany.EU.net!unido!horga!teddy!germany!open!open.de!ruhr.de!reswi!knipp!elmar
  3. From: elmar@knipp.en.open.de (Elmar Knipp)
  4. Newsgroups: comp.unix.questions,comp.unix.shell,comp.sys.hp
  5. Subject: Re: Strange side effects caused by calling sh functions with args.
  6. Message-ID: <1992Aug10.201547.946@knipp.en.open.de>
  7. Date: 10 Aug 92 20:15:47 GMT
  8. References: <smr.713169919@hitkw14>
  9. Distribution: comp
  10. Organization: Private/FRG
  11. Lines: 28
  12.  
  13. smr@iti.org (Stephen Riehm) writes:
  14.  
  15. >I am maintaining a rather large shell script, with many functions, and
  16. >it appears that if a function is called with some arguments, then the
  17. >arguments to that function become the arguments to the entire
  18. >script. Is this the normal way that this should work? I have checked
  19. >the following script, on the sun I get what I expect, but on the HP I
  20. >don't. Which shell is right?? ( My reference manual only states:
  21. >functions in shell scripts have access to $# $* and $1-9, it doesn't
  22. >specify any side effects. The HP manpage doesn't even mention sh
  23. >functions )
  24.  
  25. I had the same problem with "sh" on a HP9000/720 with HP-UX 8.07.
  26. Use the korneshell "ksh" and it works ok.
  27.  
  28. Elmar
  29.  
  30. --------------------------------+-------------------------------------
  31. Elmar Knipp                     |     Voice:       + 49 231 975015-0
  32. Knipp Satz und Bild digital     |     Fax 3:       + 49 231 975015-80
  33. Technologiepark                 |     Modem:       + 49 231 975015-82
  34. Martin-Schmeisser-Weg 9         |     ISDN-Server: + 49 231 975015-831
  35. 4600 Dortmund 50                |     E-Mail:  elmar@knipp.en.open.de
  36. Germany                         |        
  37. --------------------------------+-------------------------------------
  38.