home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!news
- From: Harald.Eikrem@delab.sintef.no
- Subject: Re: Parameter Passing
- In-Reply-To: smr@hitkw14.pki-nbg.philips.de's message of 17 Aug 92 13:00:46 GMT
- Message-ID: <1992Aug25.224815*Harald.Eikrem@delab.sintef.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: SINTEF DELAB, Trondheim, Norway.
- References: <2676@nlsun1.oracle.nl> <smr.714056446@hitkw14>
- Date: 25 Aug 92 22:48:15
- Lines: 24
-
- rgasch@nl.oracle.com (Robert Gasch) went:
-
- ! I have written a shell script which accepts one parameter. The first
- ! thing it does after making sure that it is /bin/sh and not some
- ! other shell is check if the parameters are OK.
- ! If I call it as
- ! ap STRING_ARG
- ! sh ap STRING_ARG
- ! everything is fine. The parameter is recognized and life is great.
- !
- ! Here comes the confusion: As soon as I call it as
- ! . ap STRING_ARG
- ! the parameter is not recognized anymore. Even supplying it with
- ! 2 or more parameters does not change the fact that $# is equal to 0.
-
- In (Bourne) sh:
-
- inline_proc() { . shell_proc $@; }
- inline_proc args....
-
- should arrange for argument passing within the current shell invokation.
- (Anybody care to explain why?)
-
- ~~harald E
-