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

Re: Interactive search on the command line?



On Sat, Dec 5, 2015 at 11:00 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Bart Schaefer wrote on Thu, Dec 03, 2015 at 16:59:50 -0800:
>> On Dec 3, 11:39pm, Daniel Shahaf wrote:
>> }     % () {
>> }         local haystack="$1"
> ...
>>
>> % () {
>>     local haystack=$1 needle=$2
> ...
>> (I also removed all redundant quotes and braces, since the original
>> would only work in native zsh emulation anyway.)
>
> The quotes are not redundant; they are required for compatibility with
> zsh-5.0.8 and older.  (Those releases predate the upgrade of 'local' to
> a reserved word, and, without the quotes, would perform word splitting
> before the assignment.)

Zsh doesn't wordsplit unquoted parameters and if it ever did, it was
probably before any of us were born. You may be confusing the above
with the $(foo) syntax which does wordsplit when unquoted.

-- 
Mikael Magnusson



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