I have a perl -e function in my .bashrc file.
This sources in the perl -e function so I can run it by just the command name.
I'm having trouble with the substitution of my $1 bash variable into
the perl -e function.
Here is what I have so far.
grepi ()
{
perl -ne 'BEGIN {$/ = "\n\n"} print if /$1/' < $2
}
The $2 is fine.....it works as expected, if I substitute a WORD for
$1. It is the $1 that is giving me all sorts of grief.
I've searched google, and am finally giving up figuring it out all by
myself. ;)
Basically what it does is grep out an entire paragraph at a time,
emulates a tru64 "grep -i" search.
Works fine if I enter $1 in as a word, so I know I'm close :(
Thanks
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/