I'm trying to use regexps in slocate, but it doesn't seem to work. For example, this one # slocate -r '(home|etc)' according man 7 regex should return all filename that contain 'home' OR 'etc', but slocate returns nothing, although just #slocate -r 'home' or #slocate -r 'etc' works fine. Some info here: avalon ~ # emerge -vpD slocate These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] sys-apps/slocate-2.7-r8 0 kB avalon ~ # emerge --info Portage 2203-svn (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.6-r3, 2.6.14-gentoo-r5 i686) ================================================================= System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.6.14 ccache version 2.3 [enabled] dev-lang/python: 2.3.5-r2, 2.4.2 dev-python/pycrypto: [Not Present] dev-util/ccache: 2.3 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/init.d /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.stream.uz/gentoo http://ftp.citkit.ru/pub/Linux/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo" LANG="ru_RU.koi8r" LINGUAS="en ru" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://gentoo.stream.uz/gentoo-portage" USE="x86 7zip X aalib alsa apache2 apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr cli crypt cups curl dri eds emboss encode ethereal exif expat fam ffmpeg foomaticdb fortran gd gdbm gif glut gmp gpm gstreamer gtk gtk2 hal idn imlib isdnlog jpeg kde lcms libg++ libwww mad mhash mikmod mng motif mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pcre pdflib perl php png postgres postgresql pppd python qt quicktime readline reflection sdl session spell spl ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis xine xml2 xmms xorg xv zlib linguas_en linguas_ru userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
If glibc is your C library, slocate uses GNU "basic regular expressions" as described in grep(1). These expressions use extensions to the portable POSIX "basic" REs described in regex(7). # slocate -r '\(etc\|home\)' will search for either 'etc' or 'home' in the database.
thanks for the explanation resolution: this is a feature ;)
(In reply to comment #1) > If glibc is your C library, slocate uses GNU "basic regular expressions" as > described in grep(1). These expressions use extensions to the portable POSIX > "basic" REs described in regex(7). > > # slocate -r '\(etc\|home\)' > will search for either 'etc' or 'home' in the database. > Oops! I really missed that, thanks for the explanation. My email didn't work for about 2 months, so I've just noticed your comment :) Now going reading mans, thanks again!