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

Re: field splitting with empty fields



On Tue, Oct 30, 2007 at 12:20:48AM -0400, Clint Adams wrote:
> On Mon, Oct 29, 2007 at 05:13:55PM -0700, Bart Schaefer wrote:
> > print ${list//:/$'\n'}
> > 
> > ??
> 
> Okay, I asked a stupid question.
> 
> I want the line split into words according to fields which may be
> blank.  Right now I'm substituting :x: for :: and then removing 
> the x's to ensure that the array value match up to the proper
> indices.  This seems suboptimal.

IFS=:
print -rl -- $=list

-- 
Stéphane



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