system command
Kenneth Brody
kenbrody at bestweb.net
Tue Nov 1 05:56:20 PST 2005
Quoting Fairlight (Mon, 31 Oct 2005 21:54:07 -0500):
[...]
> > ==========
> > $ echo \\
> > \
> > $ sh -c "echo \\"
> > sh: -c: line 2: syntax error: unexpected end of file
> > $ sh -c "echo \\\\"
> > \
> > $
> > ==========
>
> [cobalt] [~] [9:44pm]: sh -c "echo \\\\"
> \\
> [cobalt] [~] [9:44pm]: sh -c "echo "\\\\""
> \
> [cobalt] [~] [9:44pm]:
Note that your second command passes two backslashes to the sh command.
You have not quoted the backslashes within the quotes. Rather, you
have closed the quote, passed four unquoted backslashes (resulting in
two being passed) and then opened the quotes again. Hence the single
backslash being printed, as the command was passed one escaped backslash.
> There's one difference. In his example, the ENTIRE argument to echo,
> the whole string, is within doublequotes.
>
> But in filePro, let's look at what should be happening as opposed to
> what is:
>
> \\\" is given inside part of a literal string within "". To me, this
> translates as "literal backslash, literal doublequote". What the shell
> does with this is one thing, and I can see how he might end up with a
> single backslash after interpolation by sh.
I don't recall the exact command he built up, as it was a bit convoluted.
[...]
> THIS is why I'm confused. It shouldn't work at the -fP- level,
> nevermind
> the shell. Take this: "\\\\""
>
> You start a literal string, escape for a literal \, escape for another
> literal \, end the literal string by accident, and have a spurious
> character at the end with the third ".
>
> Why does this even pass syntax check, much less -work-?
But that string is not what you use above. You have a fourth quote --
just before the "echo". Everything is in balance.
What was the exact string built by the OP's code? (Rather than passing
it to SYSTEM, store it in a field and place that field on the screen.
Do _not_ use SHOW/MESGBOX/etc. to see the contents, as that will cause
filePro to start interpreting the backslashes.)
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list