Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Subscripting without temporaries
- X-seq: zsh-users 7347
- From: Lloyd Zusman <ljz@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Subscripting without temporaries
- Date: Tue, 13 Apr 2004 14:17:08 -0400
- Cancel-lock: sha1:pkqwu/2TSyb8KbgAQUI0AgJHjCk=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040413120053.GA4420@DervishD> <040413082948.ZM20696@xxxxxxxxxxxxxxxxxxxxxxx> <m3y8oz7rw8.fsf@xxxxxxxxxx> <20040413171142.GA28592@xxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Phil Pennock <phil.pennock@xxxxxxxxxxx> writes:
> On 2004-04-13 at 12:40 -0400, Lloyd Zusman wrote:
>> > txt="Some text [particular text] Another text"
>> > print -l $txt[1,$txt[(i)\[]-2] $txt[(r)\[,(R)\]] $txt[$txt[(I)\]]+2,-1]
>>
>> This is cool. But what options are necessary in order to make this
>> work? The commands above produce this output for me:
>>
>> Some
>> text
>> [particular
>> text]
>> Another
>> text
>>
>> This is the same as what I get with this:
>>
>> print -l $txt
>
> That means that you have SH_WORD_SPLIT turned on, which is not a zsh
> default.
I'm not sure why, but I had long ago turned on SH_WORD_SPLIT and forgot
about it. I turned it off, and now this works as advertised. Thanks!
> [ ... ]
--
Lloyd Zusman
ljz@xxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author