[ale] Perl...
Robert L. Harris
rharris at twcable.com
Fri Jun 21 13:03:45 EDT 1996
I know this is a linux forum, but I got a really stupid Perl question. I am
writing a script to rsh to a number of servers and exec an "ls -la" on the
files. I have a line that does nothing more than print the filename being
checked for debuging purposes. When this line is included, the scritp runs
fine, but when I comment out the line, or remove it, I get NO OUTPUT AT ALL...
This makes NO SENSE WHATSOEVER.....!!! Below is a copy of the script with the
line marked... Anyone have a clue???
-------------------------------------------------------------
#!/usr/bin/perl
###############################################
# Robert L. Harris
# 06-20
###############################################
#
# This script will read in a file called
# checkme.binary then rsh to each server.
# The files will then be summ'ed and compared.
# Information will then be mailed out to
# the admins.
#
###############################################
@SERVER=(batman,robin,joker,catwoman,mrfreeze,riddler,twoface,penguin);
$i=0;
open(INFILE,"<checkme.binary") || die "Can't open checkme.binary";
while(<INFILE>)
{
chop;
(@SPerms[$i], @SLink[$i], @SUid[$i], @SGid[$i], @SSize[$i], @SMon[$i],
@SDay[$i], @STime[$i], @SFile[$i])=split(' ',$_);
print "@SPerms[$i] @SLink[$i] @SUid[$i] @SGid[$i] @SSize[$i] @SMon[$i]
@SDay[$i] @STime[$i] @SFile[$i]\n";
$i++;
}
print "\n";
foreach $Server (@SERVER)
{
print "\nFiles on $Server:\n";
foreach $i (0..$#SFile)
{
$CFile=@SFile[$i];
# print "\n\n\$CFile :$CFile:\n"; <<<--- This is the line.
open(READIN,"/usr/bsd/rsh $Server \"ls -la $CFile\" |");
$LS=<READIN>;
chop($LS);
(@APerms[$i], @ALink[$i], @AUid[$i], @AGid[$i], @SSize[$i], @AMon[$i],
@ADay[$i], @ATime[$i], @AFile[$i])=split(' ',$LS); print "@APerms[$i],
@ALink[$i], @AUid[$i], @AGid[$i], @SSize[$i], @AMon[$i], @ADay[$i], @ATime[$i],
@AFile[$i]\n";
}
}
print "\n\n\n";
--
--------------------------------------------------------------
Robert L. Harris
FSN Administrator -- Time Warner Cable, Orlando Fla.
Email:
-----
Robert.Harris at twcable.com
Nomad at netwide.net
##################################################################
#Give Me Un*x or Give Me Death # #
# # My Opinions alone... Possibly #
#There are two major products # borrowed from someone else, #
# to come out of Berkeley: LSD # but it's no-one you know want #
# and Unix. Coincidence? DON'T # to know, and I'm expressing #
# THINK SO!!! # them as my own. #
##################################################################
key to UNIX:
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc
More information about the Ale
mailing list