Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Unix size again

by tobyink (Canon)
on Feb 08, 2012 at 06:51 UTC ( [id://952420]=note: print w/replies, xml ) Need Help??


in reply to Unix size again
in thread Unix size

my ($location) = @_; $location =~ s{ ([\\\']) }{ '\\' . $1 }gex; # crude escape print "\n".'Calculating Scan Statistics...'."\n"; my $cmd = "du -sk '$location'"; warn $cmd; # let's see what's actually getting executed! my $size = `cmd`; print "$size";

Replies are listed 'Best First'.
Re^2: Unix size again
by Anonymous Monk on Feb 08, 2012 at 09:10 UTC

    Its not working gives this when run: du -sk '' at test_2.pl line 5

      Then $location is not what you think it is. Debug your script.

      Well, then that means that $location is an empty string, or perhaps undefined. So the problem lies elsewhere in your code. Post more of the script.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://952420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found