SOLUTION ! ahhhhhhhhh I got it !!! :) You have to use the $ENV
grepi () { searchfor=$1 \ perl -ne 'BEGIN {$/ = "\n\n"} print if /$ENV{searchfor}/' < $2 } Just an hour or two of working on it.......and it finally pas out ! ! :) WOOT ! On Mon, Mar 30, 2009 at 11:30 AM, D. Crouse <dc...@crouse.us> wrote: > 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: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/