When using SED to replace timestamps with human readable dates the timestamp is always replaced with the epoch date plus the value placed after"\"
I have this working with Perl example but prefer to use sed. I have tried varying escape sequences and quoting "'` etc.
sed -re "s/([0-9]{10})/$(date -d @\1)/g" mac.txt
input (one string):
834|task|3||1561834555|Ods|12015|info|Task HMI starting 837|task|3||1561834702|Nailsd|5041|info|Configured with engine 6000.8403 (/opt/NAI/LinuxShield/engine/lib/liblnxfv.so), dats 9297.0000 (/opt/NAI/LinuxShield/engine/dat), 197 extensions, 0 extra drivers
Expect date conversion but results are:
834|task|3||Wed Dec 31 19:00:01 EST 1969|Ods|12015|info|Task HMI starting 837|task|3||Wed Dec 31 19:00:01 EST 1969|Nailsd|5041|info|Configured with engine 6000.8403 (/opt/NAI/LinuxShield/engine/lib/liblnxfv.so), dats 9297.0000 (/opt/NAI/LinuxShield/engine/dat), 197 extensions, 0 extra drivers 838|task.
basically: this is what is being called:
$(date -d @\1) instead of $(date -d @\1561834555)