- 论坛徽章:
- 0
|
找到了:
[root@postgresql-1 ~]# echo "sd f f [a b c cddd eee]" | awk -F '[' -vOFS='[' --profile=/tmp/a '{gsub(/
/,"",$2)}'
[root@postgresql-1 ~]# cat /tmp/a
# gawk profile, created Tue Aug 21 19:29:34 2012
# Rule(s)
{
gsub(/ /, "", $2)
}
[root@postgresql-1 ~]# echo "sd f f [a b c cddd eee]" | awk -F '[' -vOFS='[' --profile=/tmp/a 'gsub(/
/,"",$2)'
sd f f [abccdddeee]
[root@postgresql-1 ~]# cat /tmp/a
# gawk profile, created Tue Aug 21 19:29:45 2012
# Rule(s)
gsub(/ /, "", $2) {
print $0
}
[root@postgresql-1 ~]# |
|