Incorrect handling of "^[^ ]+ " in gsub
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mawk (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
echo "30 29 27 26 23" | mawk '{gsub ("^[^ ]+ ", ""); print $0}'
leads to print "23" instead of "29 27 26 23"
According to the man the leading "^" matches the front of a string, but it seems to be ignored.
This works OK with gawk.
---
Architecture: i386
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
Package: mawk 1.3.3-15ubuntu2
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
ProcVersionSign
Tags: lucid
Uname: Linux 2.6.32-42-generic i686
UserGroups:
---
ApportVersion: 2.0.1-0ubuntu12
Architecture: i386
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
Package: mawk 1.3.3-17
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
Tags: precise
Uname: Linux 3.2.0-30-
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal: /wiki.ubuntu. com/ReportingBu gs.
apport-collect 1048135
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https:/