Mindboggling difference between using "tee" and "/usr/bin/tee" in bash

I'm on Ubuntu 14.04 and I manually updated my coreutils so that "tee" is now on version 8.27
I was running a script using bash where there is some write to pipe error at some point causing the tee command to exit abruptly while the script continues to run. The newer version of tee seems to prevent this.

I had installed the newer coreutils to /usr/bin and now running

bash -c './train.sh | /usr/bin/tee -a latest-log; exit ${PIPESTATUS[0]}'

works but

bash -c './train.sh | tee -a latest-log; exit ${PIPESTATUS[0]}'

does not

This might seem normal because vanilla "tee" should be the older version. But when I check with

tee --version

it is showing 8.27!

which tee

is also showing /usr/bin/tee

/usr/bin/tee --version

Is of course showing 8.27

This issue is killing me. Please let me know what could be wrong or what I can do to diagnose this.

Hmm. That is strange.

Is there an alias to tee ?

1 Like

What output do you get from

bash -c 'type tee'