Perl 5.6.0 on SuSE 7.2. Let me post more info from my script: my $freespacecmd = "/usr/bin/ssh -l cci $phost \"/bin/df -b | /bin/grep root | /bin/grep -v grep \""; my $tmpargs = `$freespacecmd`; my @tmpfreespace = split(/\s+/, $tmpargs); my $sitefreespace = int ($tmpfreespace[4]); my $freespace = ($sitefreespace * 512); printf "%-10d bytes free in $phost:/var/tmp<BR>\n", $freespace; printf "$shipsize bytes being shipped.<P>\n";
This is the current version, I have tried many permutations of this code block. (I know the segment is ugly, it it temporary till I get the formatting correct) Any ideas?? thankx., CC ----- Original Message ----- From: "Vinicius Jose Latorre" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, October 11, 2001 5:42 PM Subject: Re: Format interger printing > > I tried: > > #!/usr/bin/perl -w > my $x = 25; > printf "%-10d bytes\n", $x; > printf "%10d bytes\n", $x; > > The result is: > > 25 bytes > 25 bytes > > Could you give more information about your system (Perl version, OS, etc.)? > > > Vinicius > > ------ Chuck <[EMAIL PROTECTED]> wrote: > > Nothing is working, I have tried every permutation. > > > > %20s > > %-20s > > %20d > > %-20d > > > > In fact, what you just suggested caused the number to display as a negative. > > > > Any ideas?? > > > > -CC > > > > ----- Original Message ----- > > From: "Vinicius Jose Latorre" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Thursday, October 11, 2001 4:08 PM > > Subject: Re: Format interger printing > > > > > > > > > > Try: > > > > > > printf "%10d bytes", $x; > > > > > > > > > Vinicius > > > > > > ------ Chuck <[EMAIL PROTECTED]> wrote: > > > > Arg, I am going crazy. Ok, it has been a long time since I was kneee > > deep in > > > > perl, but why does this not work: > > > > > > > > > > > > printf "%-10d bytes", $x; > > > > > > > > It does not pad the output with spaces or anything. > > > > > > > > if x = 25 > > > > > > > > this is the result: > > > > > > > > 25 bytes > > > > > > > > I want it tobe: > > > > > > > > 25 bytes > > > > > > > > Anyone have any ideas. I just scanned thourgh both Programming Perl and > > the > > > > Cookbook and could not find this. > > > > > > > > Thankx, > > > > CC > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]