I got an unexpected error "Memory exhausted" Reproducible: Always Steps to Reproduce: $ export LANG=C; echo test123test | sed 's/[^[:number:]]//g' Actual Results: sed: -e expression #1, char 18: Memory exhausted Expected Results: 123 or meaningful error message $ free total used free shared buffers cached Mem: 514640 505352 9288 0 164004 198900 -/+ buffers/cache: 142448 372192 Swap: 987988 18320 969668 Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1) ================================================================= System uname: 2.4.20-gentoo-r5 i686 AMD Athlon(tm) Processor GENTOO_MIRRORS="http://highlander/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss 3dnow apm avi crypt cups encode foomaticdb gif jpeg gnome libg++ mad mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib alsa gdbm berkdb slang readline arts tetex svga java X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gtk qt kde motif opengl mozilla cdr gtk2" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-mcpu=athlon -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-mcpu=athlon -O3 -pipe -fomit-frame-pointer" ACCEPT_KEYWORDS="x86" MAKEOPTS="-j5" AUTOCLEAN="yes" SYNC="rsync://highlander/gentoo-portage" FEATURES="sandbox ccache distcc"
try [[:digit:]]
Anyway, it should produce a meaningful error message
This appears to be a problem with the coreutils implementation of sed. http://www.gnu.org/software/coreutils/ In comparison, supersed says: $ export LANG=C; echo test123test | sed 's/[^[:prezel:]]//g' sed: -e expression #1, char 18: unknown POSIX class name Looks more meaningful to me.
Sorry, I was mistaken with coreutils. GNU sed got its own place: http://www.gnu.org/software/sed/sed.html Anyway, it's a GNU problem.
correct, GNU bug, not specific to Gentoo ...
Old bug.