awk -F"[][]" '{cmd="date -d@" $2;cmd |getline $2; close(cmd)}1' infile
" Thu Oct 19 03:42:35 STD 2017 Auto-save of retention data completed successfully.",
" Thu Oct 19 04:42:35 STD 2017 Auto-save of retention data completed successfully.",
" Thu Oct 19 05:42:35 STD 2017 Auto-save of retention data completed successfully.",
" Thu Oct 19 06:42:35 STD 2017 Auto-save of retention data completed successfully.",
" Thu Oct 19 07:42:35 STD 2017 Auto-save of retention data completed successfully."
Aqui, definimos um comando shell date -d@$2
para uma variável chamada cmd
. Então com cmd |getline $2
o awk
lê uma linha e passa o segundo valor do campo para o cmd
que abrimos, então precisamos fechar o comando que abrimos via pipe, então usamos close(cmd)
aqui.