Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: turning off quote interpolation



On Apr 19,  6:22pm, Eric Smith wrote:
} 
} goo () {
}   w3m "http://www.google.com/search?q=$1+$2+$3+$4+$5+$6+$7+$8&num=100";
} }

Question:  Does it harm anything to include quotes when they aren't
needed?

goo() {
  w3m "http://www.google.com/search?q=${(j:+:)${(qqq)@}}&num=100"
}

With that def'n, the command

	goo "foo bar" baz

calls w3m on a URL that looks like

	http://www.google.com/search?q="foo bar"+"baz"&num=100

where the quotes around "baz" are extraneous but (I think) harmless.

Note though that also with that def'n the command

	goo 'foo " bar'

produces the URL

	http://www.google.com/search?q="foo \" bar"&num=100

in which the backslash may not do what you want.



Messages sorted by: Reverse Date, Date, Thread, Author