Hello all. I have a weird problem. When I run this PERL one-liner by
hand it prints everything within the appropriate range...
perl -ne 'print if /NTHOST\) Total/ .. /ANR0403I/' /tmp/TIVOLI.OUT-activity-report
This prints up the summary of a Tivoli backup for a Windows client
pruned from the entire activity log.
When I put this into a shell script it doesn't pick out each host it
prints the entire activity log each time a host is called within the loop
(there are 67 hosts for this one Tivoli server).
#!/bin/bash
TIVOLIOUT=/tmp/TIVOLI.OUT-activity-report
HOSTNAMES=`perl -ne 'print if /ANE4952I/ .. /ANR0403I/' $TIVOLIOUT | awk
-F: ' {print $5}' | awk -F\) ' {print $1}' | sort | uniq`
##
## Process the hostnames
##
for i in $HOSTNAMES
do
perl -ne 'print if /${i}\) Total/ .. /ANR0403I/' $TIVOLIOUT > /tmp/blah.${i}
done
I know I am using awk in here and this could probably be done in PERL but
I am a beginner in PERL and am used to shell scripting. If someone knows
how to make this work within this shell script or knows how to do this
entirely within PERL I would be very grateful.
Thanks in advance.
Tom
**************************************************
Thomas Lewis
[EMAIL PROTECTED]
**************************************************
43rd Law of Computing:
Anything that can go wr
fortune: Segmentation violation -- Core dumped
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]