> I'm having a problem with the results of the Unix 'du' > command in that I get different results when I execute the > 'du' command from the Unix command line... > > du -sb <directory-path> > > and when I execute the 'du' command from a Perl script using > backtic statement. > > my($size) = `du -sb <directory-path>`; > > However the differing results only occurs on some directories > and not on others.
Probably because du -sb is not retuneing an array like you seem to expect of the size then directory. Try this: my($size,$dir) = split(/\s+/,qx(du -sb $mydir)); # you don't have to have $dir # sometimes you also need the entire path to program : /usr/bin/du -sb # the qx is a better way to do backtick execution, just fyi HTH DMuey > > So far I haven't seen a difference on files, just directories. > > Can anyone shed some light on this for me. > > Also, I get the daily digest so, I'd appreciate a direct reply. > > Thanks in advance > Tony F. > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]