csh programming problem
Scott Yelich
scott at cs.odu.edu
Fri Mar 16 10:04:47 AEST 1990
>(Scott Yelich)
>writes:
>>>I am trying to write a shell script that takes several arguments and
>>>passes them to child processes, i.e.
>>>#!/bin/csh
>>>...
>>foo "$@"
>>bar "$@"
> Notice that he was talking about a *C shell* script.
> $@ is a *bourne shell* construct. It doesn't work in the C shell.
Well, if I was making a shell script that JUST passed already passed
values to sub shells.... I would write it in sh because there is a
facility which makes this function extremely easy. See his previous
message for the problems csh causes....
But, if he REALLY likes csh... perhaps?
------------------------------------------------------------------------------
eval f `repeat $#argv eval 'echo -n \"$1\"\ ; shift'`
------------------------------------------------------------------------------
However, I still prefer ``foo "$@"'' for its simplicity.
> P.S. Any particular reason why your signature contained almost an entire
> page full of blank lines?
Did it? What about this one? Are you sure?
--
-----------------------------------------------------------------------------
Scott D. Yelich scott at cs.odu.edu [128.82.8.1]
After he pushed me off the cliff, he asked me, as I fell, ``Why'd you jump?''
-----------------------------------------------------------------------------
More information about the Comp.unix.wizards
mailing list