Delayed evaluation of csh variables?
Chris Shenton
chris at asylum.gsfc.nasa.gov
Tue Dec 11 08:03:08 AEST 1990
I'm trying to do a script where I set up a variable to contain a template,
then later instantiate one of the variables; the whole thing then is passed
to a command. Something like this, conceptually:
#!/bin/csh
set COMMAND = "command"
set OPTION_TEMPLATE = "-Z '$File'" # Want *literal* $File
# -- to be evaluated *later* --
# but csh evaluates it now and dies
foreach File ( $* ) # Instantiate in $OPTION_TEMPLATE ??
$COMMAND $OPTION_TEMPLATE # doesn't work
end
Is there a way to do this?
Thanks in advance.
--
chris at asylum.gsfc.nasa.gov, ...!uunet!asylum.gsfc.nasa.gov!chris, PITCH::CHRIS
More information about the Comp.unix.shell
mailing list