Re: '$' in csh
- From: Tom Gur <gur.tom@xxxxxxxxx>
- Date: Thu, 07 Jun 2007 12:51:26 -0000
On Jun 7, 3:30 pm, "Joachim Schmitz" <nospam.j...@xxxxxxxxxxxxxxxxxx>
wrote:
"Tom Gur" <gur....@xxxxxxxxx> schrieb im Newsbeitragnews:1181218415.186096.245610@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Hi,
I'm writing a program in C that runs a Java utility with several
command-line arguments.
one of the parameters that I'm passing is a home directory of a tandem
computer - which means that it contains the special character: '$'.
i.e: myprogram -path "\BLA.$DATA01.BLU"
A NonStop system? (\node.$volume.subvol)
If I'll run it literally, I'll get a: "DATA01: Undefined variable"
message.
what I usually do, with tcsh/bash is adding a '\' before every '$'.
i.e: myprogram -path "\BLA.\$DATA01.BLU"
but when I try to do it with csh, I still get an error message (the
same ol' "DATA01: Undefined variable")
A NonStop system with a C-Shell??
Don't use C-Shell for scripting...
how can I get pass that ?
How about single quotes instead of double quotes, e.g.
myprogram -path '\BLA.$DATA01.BLU'
In C you might still need to escape the \
system("myprogram -path '\\BLA.$DATA01.BLU'")
or
system("myprogram -path \"\\BLA.\\$DATA01.BLU\")
Bye, Jojo
Thanks ! single quotes works.
.
- References:
- '$' in csh
- From: Tom Gur
- Re: '$' in csh
- From: Joachim Schmitz
- '$' in csh
- Prev by Date: Re: Change one digit to 2 digits
- Next by Date: Changing the shell through a C program
- Previous by thread: Re: '$' in csh
- Next by thread: Changing the shell through a C program
- Index(es):
Relevant Pages
|