How can I take a multi-line string in zsh and split it into an array of strings, each of which contains one string?
In particular, I want to take the output of cal
June 2010
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
and turn it into
(" June 2010 " "Su Mo Tu We Th Fr Sa" " 1 2 3 4 5" " 6 7 8 9 10 11 12" "13 14 15 16 17 18 19" "20 21 22 23 24 25 26" "27 28 29 30")
What is a zsh array.
My ultimate goal is to take the output of another command and place it next to each other, so if I had
a
b
c
and
d
e
f
I would end with
a d
b e
c f
source
share