Unix/Linux Go Back    


Shell Programming and Scripting 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 Programming and Scripting


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by stompadon
stompadon's Unix or Linux Image
stompadon stompadon is offline
Registered User
 
Join Date: Nov 2017
Last Activity: 16 November 2017, 5:33 PM EST
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
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

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

works but

Code:
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

Code:
tee --version

it is showing 8.27!

Code:
which tee

is also showing /usr/bin/tee

Code:
/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; 4 Weeks Ago at 05:39 PM.. Reason: Replaced ICODE tags for (multi-line)CODE tags
Sponsored Links
    #2  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by stompadon
Scott's Unix or Linux Image
Scott Scott is online now Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 18 December 2017, 1:57 AM EST
Posts: 8,952
Thanks: 380
Thanked 1,240 Times in 1,054 Posts
Hmm. That is strange.

Is there an alias to tee?
The Following User Says Thank You to Scott For This Useful Post:
stompadon (4 Weeks Ago)
Sponsored Links
    #3  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by stompadon
Chubler_XL's Unix or Linux Image
Chubler_XL Chubler_XL is offline Forum Staff  
Moderator
 
Join Date: Oct 2010
Last Activity: 7 December 2017, 5:57 PM EST
Posts: 3,424
Thanks: 147
Thanked 1,212 Times in 1,112 Posts
What output do you get from

bash -c 'type tee'
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using "mailx" command to read "to" and "cc" email addreses from input file asjaiswal UNIX for Dummies Questions & Answers 2 10-11-2014 10:32 PM
"Help with bash script" - "License Server and Patch Updates" profileuser UNIX for Dummies Questions & Answers 25 04-01-2014 03:40 PM
awk command to replace ";" with "|" and ""|" at diferent places in line of file shis100 Shell Programming and Scripting 7 03-16-2011 09:59 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM



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