LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Shell: tr can only be used when given full path (despite being in $PATH) (https://www.linuxquestions.org/questions/programming-9/shell-tr-can-only-be-used-when-given-full-path-despite-being-in-%24path-652047/)

chochem 06-27-2008 07:16 AM

Shell: tr can only be used when given full path (despite being in $PATH)
 
I recently did a reinstall of ubuntu 8.04 and many of my scripts started malfunctioning. Checking up on it, I found that all 'tr' operations result in the error 'Broken pipe', as in
Code:

chochem@MYLAPTOP:~$ echo test
test
chochem@MYLAPTOP:~$ echo test | tr -d t
bash: echo: write error: Broken pipe

Further checking: tr can be used but only when given full path, i.e.
Code:

chochem@MYLAPTOP:~$ echo test | /usr/bin/tr -d t
es

(or when settting an alias: alias tr='/usr/bin/tr')
echo $PATH clearly indicates that /usr/bin is in path, and other /usr/bin apps work just fine. tr has execution permissions for everybody. Doing 'tr' just gives me a new line.

Can anybody explain this?

matthewg42 06-27-2008 07:18 AM

What is the output of this command?
Code:

type tr

chochem 06-27-2008 08:37 AM

D'oh... an empty shell script by the same name was in my home bin directory :o Thanks for the suggestion.


All times are GMT -5. The time now is 12:15 AM.