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

Re: lines as array elements



> 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