Previously I ran without sudo
and used tee
to display on terminal and log to file:
./my_app | tee path/to/log_file
Now I need sudo
:
sudo ./my_app | tee path/to/log_file
However, because of tee
when I add sudo
my output has weird diagonal offsets:
start of line 1 this is a test start of line 1 this is a test start of line 1 this is a test start of line 1 this is a test
It happens after I ask the user to enter input on the command line (press ENTER).
It never happened without sudo
or tee
. Is there a way to use both together?