On 2010.07.09 21:57, Uri Guttman wrote:
>>>>>> "SB" == Steve Bertrand <[email protected]> writes:
>
> SB> On 2010.07.09 21:40, Uri Guttman wrote:
>
> >> what input? i see none there. but what you want is either -p or -n. both
> >> are among the most useful options for perl oneliners. look them up in
> >> perlrun and pick which one you want.
>
> SB> | perl -p -e 's/.*\s+//'
>
> you need to test that one liner all by itself by feeding it some of
> those lines. the regex is very wrong as it will delete the entire line
> and therefore print nothing. .* matches the whole line before the
> newline and \s+ matches the trailing newline. if you added the -l option
> too, it would strip the newline off before regex is run and likely will
> do what you want. but a better regex is needed. i gotta run so i can't
> help with that now.
% egrep -r "sub \w+ {" * \
| grep -v svn \
| awk '{FS=":"} {print $1, " ", $2}' \
| awk '{FS=" "} {print $1, " ", $3}' \
| egrep "^lib/ISP/User.pm" \
| perl -ple 's/.*\s+//'
...-l......^
...prints:
new
build_db_user
client_info
add_client
delete_client
add_plan
_init_plans
username_to_login
...yeah baby!
Off to research exactly why -l did what it did. Thanks Uri!!!
Steve
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/