Skip to content

Instantly share code, notes, and snippets.

@Osse
Created October 26, 2012 05:14
Show Gist options
  • Save Osse/3956958 to your computer and use it in GitHub Desktop.
Save Osse/3956958 to your computer and use it in GitHub Desktop.
Zsh array from output
osse@osse-w760:/t/tmp.lWDzqZmrtP$ cat file.txt
a 1
b 2
c 3
d 4
e 5
osse@osse-w760:/t/tmp.lWDzqZmrtP$ a=( ${(f)$(cat file.txt)} )
osse@osse-w760:/t/tmp.lWDzqZmrtP$ echo ${a[1]}
a 1 b 2 c 3 d 4 e 5
osse@osse-w760:/t/tmp.lWDzqZmrtP$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment