NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
functions (Score:1)
Re:functions (Score:1)
rgrep() { grep -r "$1" . | grep -vE 'svn|blib' ; }
And then you say:
$ rgrep $string
Advanced Bash-Scripting Guide (Score:1)
Look at ack (Score:2)
It doesn't exclude blib yet, but it does ignore .svn and CVS directories, and it does recursing into directories by default.
--
xoa
Svk (Score:1)
That's why I use Svk. Well, okay... I use it for other reasons, but that's a nice benefit.
(No, bash aliases can't take arguments.)
rgrep for excluding .svn and blib (Score:1)
This seems like one of those things that seemed "too small to put on CPAN", but probably isn't.
Alias syntax (Score:1)
alias stringgrep 'grep -r \!*
I suspect the bash syntax is similar.
Re:Alias syntax (Score:1)
No, there isn't an equivalent syntax for Bash aliases. This is because in C Shell the
!there is a history substitution, and history works differently in Bash from in C Shell.As others have said, use a function; there isn't really any advantage in using a Bash alias over a function (other than you're more likely already to know the alias syntax).
I think this should do what you want (untested):
(Function name courtesy of meta [cpan.org].)
Smylers
Bash functions (Score:1)
Bash functions are amazingly useful, and ridiculously simple. Just put something like this in your .bashrc.
ovidgrep () { .| grep -vE 'svn|blib'grep -r "$1"
}