Subject: | |
From: | |
Reply To: | VANCE,JEFF (HP-Cupertino,ex1) |
Date: | Wed, 22 Mar 2000 14:46:34 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
> > #2\SYS\PUB:setvar retry 3
> > #2\SYS\PUB:echo exit > tmp1
> > #2\SYS\PUB:setvar line1 "while count < !retry"
> > #2\SYS\PUB:setvar line2 "run ftp.arpa.sys < tmp1"
> > #2\SYS\PUB:echo !line1
> > while count < 3
> > #2\SYS\PUB:echo !line2
> > run ftp.arpa.sys
If you had entered :showvar you'd see:
:showvar line2
LINE2 = run ftp.arpa.sys < tmp1
So you see that the CI does not do IO redirection if the
redirection symbols are enclosed in quotes. I refer you to
http://jazz.external.hp.com/papers/SolSymposium_00/CIprogramming/sld007.htm
for more info on CI IO redirection.
Mark is also correct that the CI does not do IO redirection of the
token following the redirection symbol is not a legal file name.
When you execute echo !line2 the CI substitutes the value of LINE2
into the command line. So the command looks like:
:echo run ftp.arpa.sys < tmp1
The ECHO command does not read from $STDIN, so the "< tmp1" has no
meaning to ECHO, but the CI processes the IO redirection before the
ECHO command is invoked. Thus $STDIN is redirected to TMP1 and ECHO
is invoked with the following:
run ftp.arpa.sys
ECHO dutifully writes to $STDLIST the arguments passed in, as you
have already seen.
If you want the CI to not interpret "<" as IO redirection you can:
- precede the symbol with ! to escape its special meaning, e.g.
run ftp.arpa.sys !< tmp1
- put the IO redirection part inside single or double quotes.
- put the IO redirection part inside square brackets.
HTH,
Jeff Vance, CSY
|
|
|