This repository has been archived by the owner. It is now read-only.

shell misbehaviour #127

Closed
ahycka opened this Issue Feb 14, 2014 · 2 comments

Comments

Projects
None yet
2 participants

ahycka commented Feb 14, 2014

hello
I think there's a bug in grep version distributed along git
this is what happens on my windows XP with git version 1.8.5.2-preview20131230

Ana@QUEEN ~/Desktop/xxx/xxx/Copia de 2014-02-14
$ ls
syslog syslog.1

Ana@QUEEN ~/Desktop/xxx/xxx/Copia de 2014-02-14
$ grep -h CFAR $( ls -1vr syslog*) > CFAR
grep: syslog.1: No such file or directory
grep: syslog: No such file or directory
grep: : No such file or directory

Ana@QUEEN ~/Desktop/xxx/xxx/Copia de 2014-02-14
$

This is what happens on a Debian system
ana@collins:/tmp/Copia de 2014-02-14$ ls
syslog syslog.1
ana@collins:/tmp/Copia de 2014-02-14$ grep -h CFAR $( ls -1vr syslog*) > CFAR
ana@collins:/tmp/Copia de 2014-02-14$

thank you

rctay commented Feb 14, 2014

Try using /bin/ls instead of ls. This is usually good practice for
scripts etc. because most user shells alias ls, eg. in msysgit:

rc@USER /tmp
$ alias
alias ll='ls -l'
alias ls='ls -F --color --show-control-chars'

ahycka commented Feb 14, 2014

You are right!
I tried with /bin/ls or \ls and it works perfectly!

Ana@QUEEN ~/Desktop/xxx/xxx/Copia de 2014-02-14
$ grep -h CFAR $( /bin/ls -1vr syslog*) > CFAR

Ana@QUEEN ~/Desktop/xxx/xx2/Copia de 2014-02-14
$ grep -h CFAR $( \ls -1vr syslog*) > CFAR

Because, of course, i have a ls alias....
Ana@QUEEN ~/Desktop/xxx/xxx/Copia de 2014-02-14
$ alias
alias gedit='"/c/Program files (x86)/gedit/bin/gedit.exe"'
alias ls='ls --color'
alias rar='"/c/Program files (x86)/WinRAR/Rar.exe"'
alias unrar='"/c/Program files (x86)/WinRAR/UnRAR.exe"'

Thank you very much!

@ahycka ahycka closed this Feb 14, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.