开发者

get list from line-separated output

开发者 https://www.devze.com 2023-01-10 13:04 出处:网络
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 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

精彩评论

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