I have the command in a script:
exec su -s /bin/sh -c 'exec "$0" "$@" | ts "[%Y-%m-%d %H:%M:%S]"' user -- test.python $FULLPATH &> log &
FULLPATH is the path of the test Python file. With this command I expected the output of the script to be written into the log file with timestamps from the
That does actually not happen, the output is written without any timestamps, other than that i also tried to do this:
exec su -s /bin/sh -c 'exec "$0" "$@"' user -- test.python $FULLPATH | ts "[%Y-%m-%d %H:%M:%S]" &> log &
This also gives the same result with the previous command.
Any thoughts on why this happens and a possible solution would be much appreciated, thank you.