sed命令将换行转换为逗号

ips_comma=$(sed ':t;N;s/ /,/;b t' file)

参考:https://zhidao.baidu.com/question/468603364.html

原文地址:https://www.cnblogs.com/wang--lei/p/8125620.html