Avoid writing progress bars to file in linux
<p>I have a process that prints output, but this output also includes loading bars.</p>

<p>I would like to both write this output to a file and display this output.</p>

<p>Normally I could just do:</p>

<p><code>./my_process.sh | tee -a my_log_file.txt</code></p>

<p>or </p>

<pre><code>./my_process.sh &gt;&gt; my_log_file.txt
tail -f my_log_file.txt
</code></pre>

<p>This prints everything to my terminal, however it also prints EVERYTHING to the log file, including each step of the progress bar!</p>

<p>I would like to exclude progress bar iterations from getting printed to the log file.</p>

<p>For my purposes, any line with a carriage return can be excluded from the log file. How can I exclude carriage return lines from getting appended to the log file while still printing them to stdout on the terminal? </p>