I am processing a file full of a UNIX time string. I want to convert them all into a readable human.
The file looks like this:
1153335401 1153448586 1153476729 1153494310 1153603662 1153640211
Here's the script:
#! / Bin / bash FILE = "test.txt" cat $ FILE | While reading the line; What does the Perl-A print scaler (GMTE ($ line)), "\ n" 'done'
This is not working Out of every line I get the output Thursday, 1 January 00:00:00 1970 I think line breaks are being raised and this is why it is not working. any idea? I'm using Mac OSX which makes a difference.
$ perl -lne 'print scaler gmtime $ _' Test.txt Mercury July 19 18:56: 41 2006 Fri Jul 21 02:23:06 2006 Fri Jul 21 10:12:09 2006 Friday Jul 21 15:05:10 2006 Sat 22 Jul 21:27:42 2006 Sun July 23 07:36:51 2006
Comments
Post a Comment