[comp.unix.questions] passing parameters in shell scripts

tonytran@portia.Stanford.EDU (Tony) (05/14/91)

I have variables on a script whose values I'd like to pass on to
be used on another script.  Can anyone suggest the best method to
pass parameters in a shell script?

Thanks in advance.
Tony

--
tonytran@leland.stanford.edu

Dan_Jacobson@ATT.COM (05/14/91)

>>>>> On 13 May 91 21:52:02 GMT, tonytran@portia.Stanford.EDU (Tony) said:

Tony> I have variables on a script whose values I'd like to pass on to
Tony> be used on another script.  Can anyone suggest the best method to
Tony> pass parameters in a shell script?

$ cat script1
other_script ${1+"$@"}

[trusty Bourne shell compatible version]

mck@hpcuhc.cup.hp.com (Doug McKenzie) (05/15/91)

> I have variables on a script whose values I'd like to pass on to
> be used on another script.  Can anyone suggest the best method to
> pass parameters in a shell script?

Hope this helps.

Doug McKenzie
HP HP-UX Support
mck@cup.hp.com

#422: cat blah
#!/bin/ksh
echo blah dollar star is $*
echo calling blah2
blah2 $*
echo returned from blah2

#423: cat blah2
#!/bin/ksh
echo in blah2
echo blah2 dollar star is $*
echo about to leave blah2

#424: blah 1 2 3
blah dollar star is 1 2 3
calling blah2
in blah2
blah2 dollar star is 1 2 3
about to leave blah2
returned from blah2