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

Re: turning off quote interpolation



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

If memory serves, you can't turn off the quoting stuff since that
happens well before it's passed to a function or alias.

FWIW, the power of zsh lets you do something like join the elements of
an array together with a specified string used between each element.

Eg, my equivalent function is defined as:

  function google {
        ${WebBrowser:-w3m} "http://www.google.com/search?q=${(j:+:)@}"
  }

So, something like:

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

should help you get rid of that limit which you have.

Beyond that, it's just a matter of getting into the habit of trapping
quotes around strings, to allow things like & in a URL.

I got in the habit of things like:
% google '"Elizabeth Moon"'
to look up information on one of my favourite authors, for instance.

-Phil



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