i thought grep was broken, but it’s not. see below:
james@dazzle:~$ echo $0
bash
james@dazzle:~$ echo 'hello world' > .hello
james@dazzle:~$ grep 'hello world' *
james@dazzle:~$ grep 'hello world' .*
.hello:hello world
james@dazzle:~$ shopt | grep dotglob
dotglob off
james@dazzle:~$ shopt -s dotglob
james@dazzle:~$ shopt | grep dotglob
dotglob on
james@dazzle:~$ grep 'hello world' *
.hello:hello world
james@dazzle:~$ shopt -u dotglob
james@dazzle:~$ shopt | grep dotglob
dotglob off
james@dazzle:~$ rm .hello
james@dazzle:~$
the problem as it turns out is that the glob character `*’ (the asterisk) doesn’t expand to include dot files unless you have the shopt variable set. so you can either use to workaround shown above or set it. personally i’ll keep mine off.
Author Archives: purpleidea
Reply
Server Fault
Server Fault, the question and answer forum for systems administrators opened their doors today to the public. It is created by the same notorious bloggers who brought you Stack Overflow, Joel on Software and the Daily WTF.
Go have a look, ask a question, answer a question and have fun!
community
first babble
hello! this blog is intended to be a place where ramblings and discoveries, by and for systems administrators and programmers can be posted and seen by many to ultimately help in the dissemination of useful findings that we wish we had been able to have read here earlier.
if that didn’t make too much sense, perhaps i could rephrase it.