Home Man
Today's Posts

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

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

shell scripts, solved

Login to Reply

Thread Tools Search this Thread
# 1  
Old 11-16-2017
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.

Last edited by Scott; 11-16-2017 at 04:39 PM.. Reason: Replaced ICODE tags for (multi-line)CODE tags
# 2  
Old 11-16-2017
Hmm. That is strange.

Is there an alias to tee?
The Following User Says Thank You to Scott For This Useful Post:
stompadon (11-16-2017)
# 3  
Old 11-16-2017
What output do you get from

bash -c 'type tee'
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }" Siddharth shivh Shell Programming and Scripting 3 05-31-2018 10:46 AM
Using "mailx" command to read "to" and "cc" email addreses from input file asjaiswal UNIX for Dummies Questions & Answers 2 10-11-2014 09:32 PM
"Help with bash script" - "License Server and Patch Updates" profileuser UNIX for Dummies Questions & Answers 25 04-01-2014 02:40 PM
Find lines with "A" then change "E" to "X" same line nightwatchrenba Shell Programming and Scripting 10 08-28-2013 05:00 AM
awk command to replace ";" with "|" and ""|" at diferent places in line of file shis100 Shell Programming and Scripting 7 03-16-2011 08:59 AM
Difference between "/bin/bash" & "/bin/sh" xerox UNIX for Dummies Questions & Answers 3 02-28-2011 09:03 AM
Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes" hakermania Shell Programming and Scripting 4 12-11-2010 09:24 AM
ps -ef | grep "string1" "string2" " "string3" steve2216 Shell Programming and Scripting 11 09-03-2010 11:08 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 12:52 AM

All times are GMT -4. The time now is 02:02 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password