开发者

get list from line-separated output

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)"});

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜