>In shell-script I get a variable with command line:
>
>AUXIP=`cat $INPUTDB/postgresql.conf | grep "localhost"
> | awk '{print $3}' | head -n1`
>
Hello,
In Perl it can most likely be written as:
open FILE,"$INPUTDB/postgresql.conf" or die $!;
@tmp = map { (split)[2] } grep { /localhost/ } <FILE>;
close FILE;
print shift @tmp;
See:
perldoc -f grep
perldoc -f sort
perldoc -f split
(Warning for no test.)
--
http://home.arcor.de/jeffpang/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/