Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lines as array elements
- X-seq: zsh-users 924
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxxxxxxx>
- To: unpingco@xxxxxxxxxxxx (Jose Unpingco)
- Subject: Re: lines as array elements
- Date: Sat, 28 Jun 1997 02:03:15 -0400 (EDT)
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <9706272238.AA12078@xxxxxxxxxxxxxxxxx> from Jose Unpingco at "Jun 27, 97 03:38:18 pm"
> what I'd like to do is get each line into an array element like
[...]
> I've tried x=(`cat file`) but that splits on the spaces between the
> numbers. I've looked at the IFS variable and tried to change it to
> newline but that doesn't work as expected.
There were several solutions, but here is a simple one:
x=( "${(f)$(< file)}" )
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author