I want to get a ZSH list from a line-separated output. In my case, from the following command:
ssh myhost ls /Applica开发者_StackOverflow中文版tions
I tried $(ssh myhost ls /Applications)
but that doesn't work (it splits also at spaces).
lines=("${(@f)$(ssh myhost ls /Applications)}")
${(ps.\n.)"$(ssh myhost ls /Applications)"}
myarray=(${(f)"$(ssh myhost ls /Applications)"});
精彩评论