in reply to Quotable Quotes
In your second example,
But, when run at a DOS prompt, the command: C:\>"echo hello" produces '"echo hello"' is not recognized as an internal or external command, operable program or batch file.Why is there an expectation that Perl is involved at all? It looks like you threw a string in double quotes at cmd.exe.
If you simply: C:\>echo hello you get: hello because echo is a DOS internal command.
Perhaps your original example didn't need the double quotes?
C:\>perl -e "print STDERR `echo hello`"; produces hello
and I've found that when I wanted double-quotes in my on-liners on Windows, I needed (ready for absurdity?) triple double-quotes.
C:\>perl -e "print STDERR `echo """hello"""`"; produces "hello"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quotable Quotes
by b4swine (Pilgrim) on Sep 07, 2007 at 16:01 UTC | |
by goibhniu (Hermit) on Sep 07, 2007 at 20:29 UTC | |
by goibhniu (Hermit) on Sep 07, 2007 at 20:58 UTC | |
by narainhere (Monk) on Sep 07, 2007 at 19:16 UTC |