On 29 Sep, Ole Kofoed Hansen wrote:
On Thu, 28 Sep 2000, John Grant wrote:
I use perl a lot so I'm particularly susceptable to the version of this problem where I get a command like:
perl -e '$bar = "xyzzy"; print "foo\n\t$bar\n"'
Have you tried this:
perl -e "$bar = "xyzzy"; print "foo\n\t$bar\n""
< [...] This doesn't answer the real question about quoting and escaping. Ole has the right answer there by suggesting the bash man page, since it is a shell issue - and sometimes a confusing one at that. But narrowly targeting the perl one-liners, you can usually get by without escaping quotes, unless you need a literal one. Multiple pairs of single quotes inside of double quotes are ok, as are multiple pairs of double quotes inside single ones. In those instances where you need nested quotes of the same variety, or just don't to think about it, the quote operators should work nicely. perl -e '$foo=q/bar/;$bar=q/baz/; $baz=qq/$foo/; print qq/$foo $bar $baz\n/; print q/$foo $bar $baz/,qq/\n/;' bar baz bar $foo $bar $baz That doesn't solve all the quoting issues, but does simplify some of them. - Don -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq