I have the following command that returns a date from a file
tail -1 MyFile | awk -F ',' '{print $7}'
Returns date like this 04/16/12 20:44:19
I want to convert that date to epoch time by modifying the awk command somehow by feeding $7 into date -d $7 +%s
I think
awkis a bit heavy for this job,cutmaybe a little bit lighter:But of course you can do it with
awkas well: