Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Search Forums:



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-03-2012
Registered User
 

Join Date: Jul 2009
Location: Pune, India
Posts: 42
Thanks: 20
Thanked 0 Times in 0 Posts
What is this perl snippet is doing?


Code:
perl -e '@stat=stat("/etc/passwd");$now_string=localtime($stat[9]);print $ARGV[0].":$now_string\n"' ./file_name

Please if anyone can describe it.

Thanks in advance
Sponsored Links
    #2  
Old 02-03-2012
Registered User
 

Join Date: Oct 2010
Location: Bilbao, Spain
Posts: 574
Thanks: 8
Thanked 157 Times in 155 Posts
Hi ezee,

It prints the name of the input file plus a colon and modification time of file /etc/passwd in a readable mode, like:

Code:
./file_name:Mon Dec 12 11:19:15 2011

Regards,
Birei
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to truncate all the lines except a specific snippet. abinash UNIX for Dummies Questions & Answers 3 12-05-2010 02:06 AM
Code snippet for signals joker40 UNIX for Dummies Questions & Answers 6 10-22-2010 12:18 PM
gui text box code snippet? Allasso Shell Programming and Scripting 1 06-29-2008 01:00 PM
Can someone help translate this snippet? Heron Shell Programming and Scripting 7 03-29-2005 02:01 AM



All times are GMT -4. The time now is 03:36 AM.