I have a command that outputs a Unix timestamp followed by some text:
> mycommand
1484169138 happened XYZ
1484169139 happened XZY
...
I want to turn the timestamps into human readable strings but do not seem to be able to figure out how.
I have tried various tools (like sed
and awk
). The following answer on stackoverflow seems quite close; but I am on FreeBSD which does not seem to have the GNU extension to use e
:
$ mycommand |sed -E 's#([0-9]{10})#date -r \1#e'
sed: 1: "s#([0-9]{10})#date -r \1#e": bad flag in substitute command: 'e'