有没有办法打印由 OFS 分隔的所有记录,而无需输入每个列号。
#Desired style of syntax, undesired result
[kbrandt@glade: ~] echo "1 2 3 4" | gawk 'BEGIN { OFS=" :-( "}; {print $0}'
1 2 3 4
#Desired result, undesired syntax
[kbrandt@glade: ~] echo "1 2 3 4" | gawk 'BEGIN { OFS=" :-) "}; {print $1,$2,$3,$4}'
1 :-) 2 :-) 3 :-) 4