Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: du with backticks

by pc88mxer (Vicar)
on Mar 20, 2008 at 05:09 UTC ( [id://675157]=note: print w/replies, xml ) Need Help??


in reply to du with backticks

This is not your problem, but it might be of interest to know that ~-expansion is actually done by the shell. So, even though the following calls look like they do the same thing, the first two work as expected, but the last one doesn't:
`du ~user`; system("du ~user"); system("du", "~user"); # doesn't work
Generally you are better off calling getpwnam() to get a user's home directory instead of using ~user.
my $user = ...; my $home = (getpwnam($user))[7]; system("du", $home); # etc.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found