In my .bash_profile I have
script -a -t 0 session.log which automatically records all terminal input/output into the session.log file. I know this command comes with an optional flag to record the time differences in another file but I was wondering if there was another way to prefix the session.log lines with a timestamp.
Can I pipe the writes to a different shell function before writing it to session.log? Something like this
script -a >(add_timestamps.sh >> session.log) (does not work)