help with syntax...filepro 5.0.13 OSR 5.0.7
Fairlight
fairlite at fairlite.com
Thu Jan 19 18:47:41 PST 2006
Four score and seven years--eh, screw that! At about Thu, Jan 19, 2006 at
05:09:38PM -0800, Enrique Arredondo blabbed on about:
> I'm trying to generate a file that will make hundreds of symbolic links
> but I'm missing the right combination of 's and `s within the system
> noredraw command.
>
> here's where the magic takes place :
>
> Then: system noredraw "umask 0;cd /vegedoc;FI=`find . -name"<imp(4){".pdf -print`;echo 'ln -s $FI"<dd{"' >> /usr2/tmp/foundit"
>
> the outfile being created looks like this :
>
> ln -s $FI /vegedoc/CoreCenter/AMC/AMC-150/1---A22-EnsambleDeMotor/E-150-A22.pdf
>
> The $FI becomes not a variable when you put in between 's but if I don't
> put the 's the system tries to execute a ln command.
>
> if I replace the echo part with " ; echo $FI >> /usr2/tmp/foundit"
>
> I get the real value of $FI.
>
> Can you find the problem ??
You don't know (or forgot) about interpolation at the shell level.
Single quotes tell the shell to accept anything within them as a literal,
doing no variable interpolation. Hence, you get a literal string.
No quotes results in automatic interpolation. Hence, your real value in
the substitution you provided last.
Double quotes, on the other hand, preserve the quoting mechanism, but allow
for interpolation of variables within the quoted segment.
What you -really- want is:
" ; echo \"ln -s $FI"<dd{"\" >>/usr2/tmp/foundit"
This lets the $FI be interpolated within the quoted section of the command.
mark->
More information about the Filepro-list
mailing list