shell处理字符串拼接

2025-05-10 00:33:32
推荐回答(1个)
回答1:

你确定最后也有分号?确定用:

awk '{s=s$0";"}END{print s}' urfile


否则:

sed ':a;N;s/\n/;/g;ta' urfile