Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下 grep 命令echo $a | grep -Po '(?<=demo-jms2;)[^;]+'。如何用逗号分隔此命令的结果?
echo $a | grep -Po '(?<=demo-jms2;)[^;]+'
如何将 grep 输出通过管道传输到tr '\n' ','
tr '\n' ','
for i in `echo $a | grep -Po '(?<=demo-jms2;)[^;]+'` do echo -n $i, done