This is what I have to start out with
more file
1208217600
1208131200
1193806800
I want to convert the epoch column into a human-readable format. My file has hundreds of these epoch times that I want to loop through and convert. (The epoch time is really the last column of the line)
This is what I am trying
cat file |while read EPOCH
do
READABLE=`gawk 'BEGIN{print strftime("%c", $EPOCH )}'` # not working
READABLE=`gawk 'BEGIN{print strftime("%c",1144172897)}'` # works
echo $READABLE
done
why does the second line work when I hard code the epoch time in?
and the first line where I am reading in the variable not work?
reading about the syntax of the strftime
strftime([format [,timestamp]])
evidently timestamp has to be a number and not a variable
any ideas?
I don't have perl on this box but I do have nawk and awk and sed
Thanks
David