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