echo This++++this+++is+not++done | awk '{ sub(/\++/," "); print }' This this+++is+not++done
预期:
This this is not done
任何想法为什么这不起作用?
echo This++++this+++is+not++done | awk '{gsub(/\++/," ");}1'
子函数只替换第一个匹配,替换所有匹配使用gsub.