Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Perl one liner and stat function

by ikegami (Patriarch)
on Mar 23, 2009 at 22:59 UTC ( [id://752744]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -MFile::stat -le'$pv=stat(shift); print "$pv->uid,$pv->gid,$pv->m
    +ode"' /dir/filename
    
  2. or download this
    perl -le'$,=","; print((stat shift)[4,5,2])' /dir/filename
    
  3. or download this
    perl -e'printf "%s,%s,%04o\n", (stat shift)[4,5,2]' /dir/filename
    
  4. or download this
    perl -e'printf "%s:%s,%s,%04o\n", $_, (stat)[4,5,2] for @ARGV' file1 f
    +ile2
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-05-21 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found