Help save net neutrality! Learn more.
Close

#671 grep -r does not work with MSYS-1.0.10

closed-invalid
MSYS (75)
2014-06-21
2004-10-26
No

grep -r does not work with MSYS-1.0.10
Steps to reproduce:
1. cd , for example, lib/boost
2. grep -r "lambda" *.hpp
Expected result: looong list of files
Actual result: grep: *.hpp: No such file or directory
Reproducible: Always
OS: WinXP SP1

uname -a:
MINGW32_NT-5.1 PRIVAT-6W6SM6PC 1.0.10(0.46/3/2)
2004-03-15 07:17 i686 unknown

which grep:
/bin/grep

msysinfo all:

MSYS 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown;
targ=MINGW32
GNU bash, version 2.04.0(1)-release (i686-pc-msys);
ENV=.profile
GNU Make version 3.79.1,Built for i686-pc-msys;
MAKE_MODE=unix
gcc.exe (GCC) 3.2.3 (mingw special 20030504-1);
targ=MINGW32
GNU ld version 2.13.90 20030111
789320 Tue Mar 16 11:32:49 2004 /bin/msys-1.0.dll
135680 Tue Mar 16 11:32:48 2004 /bin/make.exe
82432 Sun May 04 21:38:20 2003 /mingw/bin/gcc.exe
566272 Sun Jan 12 03:42:48 2003 /mingw/bin/ld.exe
HOME=/c/Documents and Settings/gman
Sysname=MINGW32_NT-5.1 OSTYPE=msys TERM=msys
PATH=.:/usr/local/bin:/mingw/bin:/bin:/c/Program/Vim/vim62:/c/Pr
ogram/Python231:/c/Program/GnuWin32/bin:/c/Program/Perl/bin/:/c/
Program/smlnj-110.0.7/bin:/c/Program/Intel/VTune/CGGlbCache:/c/P
rogram/Intel/VTune/Shared/Bin:/c/Program/Delade
filer/Intel/Shar
ed
Files/IDVC:/c/Program/Intel/VTune/Analyzer/Bin:/c/WINDOWS/sys
tem32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program/Panda
Softw
are/Panda Antivirus
Titanium:/c/Program/doxygen/bin:/c/Program/W
inCvs
1.3:/c/Program/WINCVS~1.3/CVSNT:/usr/bin:/c/Program/XSV:/c
/Program/Delade filer/GTK/2.0/bin:/c/Program/NVIDIA
Corporation/
Cg/bin:.
$ ls -tx /c/Documents and Settings/gman
uname.txt ntuser.dat.LOG
Recent/ .bash_history
Skrivbord/ _viminfo
ntuser.dat Application Data/
gsview32.ini Mina dokument/
Cookies/ Favoriter/
.gimp-2.0/ .fonts.cache-1
Start-meny/ PsiData/
UserData/ Temporary Internet Files/
Tidigare/ SendTo/
ntuser.ini Lokala inställningar/
Nätverket/ Skrivare/
Mallar/

bbfe534c85236d94683f3461829ef10b */bin/msys-1.0.dll
0e7941487ca8156a25b46b0b8f9a8bd9 */bin/make.exe
aad05e77b37da603d3097824834fdfc8 */mingw/bin/gcc.exe
2a5cf34e94bb25814907a8111fd937a7 */mingw/bin/ld.exe

In /etc/fstab:
c:/MinGW /mingw

In /etc/profile:
export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
export HOME LOGNAME MSYSTEM HISTFILE
export MAKE_MODE=unix
export PS1='\[\033]0;$MSYSTEM:\w\007

%%% MSYS dll major: 1000
%%% MSYS dll minor: 10
%%% MSYS dll epoch: 19
%%% MSYS dll bad signal mask: 19005
%%% MSYS dll old termios: 5
%%% MSYS dll malloc env: 28
%%% MSYS api major: 0
%%% MSYS api minor: 46
%%% MSYS shared data: 3
%%% MSYS dll identifier: cygwin1
%%% MSYS mount registry: 2
%%% MSYS cygnus registry name: msys
%%% MSYS cygwin registry name: 1.0
%%% MSYS program options name: Program Options
%%% MSYS cygwin mount registry name: mounts v2
%%% MSYS cygdrive flags: cygdrive flags
%%% MSYS cygdrive prefix: cygdrive prefix
%%% MSYS cygdrive default prefix:
%%% MSYS build date: Mon Mar 15 07:17:24 EST 2004
%%% MSYS shared id: cygwin1S3

!C:='C:\msys\bin'
ALLUSERSPROFILE='C:\Documents and Settings\All Users'
APPDATA='C:\Documents and Settings\gman\Application Data'
BASH=/usr/bin/sh
BASH_VERSINFO=([0]="2" [1]="04" [2]="0" [3]="1"
[4]="release"
[5]="i686-pc-msys")
BASH_VERSION='2.04.0(1)-release'
BGCOLOR=LightYellow
BISTRO_GLOBAL_CACHE_DIR='C:\Program\Intel\VTune\CGGlbCache'
CG_BIN_PATH='C:\Program\NVIDIA Corporation\Cg\bin'
CG_INC_PATH='C:\Program\NVIDIA Corporation\Cg\include'
CG_LIB_PATH='C:\Program\NVIDIA Corporation\Cg\lib'
CLASSPATH='C:\Program\Intel\VTune\Analyzer\Bin;.'
CLIENTNAME=Console
CM_PATH='C:\Program\smlnj-110.0.7\lib'
COLORFGBG='default;default'
COLORTERM=rxvt
COMMONPROGRAMFILES='C:\Program\Delade filer'
COMPUTERNAME=PRIVAT-6W6SM6PC
COMSPEC='C:\WINDOWS\system32\cmd.exe'
DIRSTACK=()
DISPLAY=:0
EUID=500
FGCOLOR=Navy
GROUPS=()
HISTFILE='/c/Documents and Settings/gman/.bash_history'
HOME='/c/Documents and Settings/gman'
HOMEDRIVE=C:
HOMEPATH='\'
HOSTNAME=PRIVAT-6W6SM6PC
HOSTTYPE=i686
IFS='
'
INFOPATH='C:\Mingw\info;C:\MSYS\info'
INTEL_LICENSE_FILE='C:\Program\Delade filer\Intel\Licenses'
LANG=SV
LOGNAME=gman
LOGONSERVER='\\PRIVAT-6W6SM6PC'
MACHTYPE=i686-pc-msys
MAKE_MODE=unix
MINGW32BGCOLOR=LightYellow
MINGW32FGCOLOR=Navy
MSYSBGCOLOR=White
MSYSFGCOLOR=Black
MSYSTEM=MINGW32
NUMBER_OF_PROCESSORS=1
OPTERR=1
OPTIND=1
OS=Windows_NT
OSTYPE=msys
PATH='.:/usr/local/bin:/mingw/bin:/bin:/c/Program/Vim/vim62:/c/P
rogram/Python231:/c/Program/GnuWin32/bin:/c/Program/Perl/bin/:/c
/Program/smlnj-110.0.7/bin:/c/Program/Intel/VTune/CGGlbCache:/c/
Program/Intel/VTune/Shared/Bin:/c/Program/Delade
filer/Intel/Shared
Files/IDVC:/c/Program/Intel/VTune/Analyzer/Bin:/c/WINDOWS/system
32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program/Panda
Software/Panda Antivirus
Titanium:/c/Program/doxygen/bin:/c/Program/WinCvs
1.3:/c/Program/WINCVS~1.3/CVSNT:/usr/bin:/c/Program/XSV:/c/Progr
am/Delade filer/GTK/2.0/bin:/c/Program/NVIDIA
Corporation/Cg/bin:.'
PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PIPESTATUS=([0]="0")
PPID=2020
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER='x86 Family 6 Model 11 Stepping 1,
GenuineIntel'
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0b01
PROGRAMFILES='C:\Program'
PROMPT='$P$G'
PS4='+ '
PWD='/c/Documents and Settings/gman'
SESSIONNAME=Console
SHELL=/bin/sh
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=2
SYSTEMDRIVE=C:
SYSTEMROOT='C:\WINDOWS'
TEMP=/tmp
TERM=msys
TMP=/tmp
UID=500
USERDOMAIN=PRIVAT-6W6SM6PC
USERNAME=gman
USERPROFILE='C:\Documents and Settings\gman'
VS71COMNTOOLS='C:\Program\Microsoft Visual Studio .NET
2003\Common7\Tools\'
VTUNE_GLOBAL_DIR='C:\Program\Intel\VTune\global_data\'
WINDIR='C:\WINDOWS'
WINDOWID=167838904
_=echo

Discussion

  • Earnie Boyd

    Earnie Boyd - 2004-10-29

    Logged In: YES
    user_id=15438

    Grep will only recurse if the list of arguments contains a
    directory. Since *.hpp only produces files then a directory
    will not be in the list of arguments. To do what you're
    wishing to do try:

    grep -r "lambda" . | grep .hpp:

     
  • Earnie Boyd

    Earnie Boyd - 2004-10-29
    • status: open --> closed-invalid
     
  • Ambrose Dewart

    Ambrose Dewart - 2004-10-30

    Logged In: YES
    user_id=890056

    Strange, I remember it working that way in 1.0.9.
    Thanks, anyway.

     
  • Ambrose Dewart

    Ambrose Dewart - 2004-10-31

    Logged In: YES
    user_id=890056

    Update:
    I installed Tim Charron's win32 version of grep
    and it has this -S(search in subdirectories) switch
    which does precisely what I want.
    Is it possible to include his changes in msys's grep?

     
  • Aaron W. LaFramboise

    Logged In: YES
    user_id=1040098

    Well, the grep in MSYS is from GNU coreutils, so you should
    talk to its maintainers about it. However, its fairly
    unlikely that they'd add these sort of semantics, as they
    are very different from those of traditional Unix tools. As
    far as I know, no Unix or POSIX grep has a way to filter
    filenames while recursing. Perhaps another way to do what
    you want is to use the find program:

    find -type f -name *.hpp | xargs grep lambda

     

Log in to post a comment.