Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-27-2008, 07:16 AM   #1
LQ Newbie
Registered: May 2008
Posts: 29

Rep: Reputation: 15
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
chochem@MYLAPTOP:~$ echo 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.
chochem@MYLAPTOP:~$ echo test | /usr/bin/tr -d t
(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?
Old 06-27-2008, 07:18 AM   #2
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
What is the output of this command?
type tr
Old 06-27-2008, 08:37 AM   #3
LQ Newbie
Registered: May 2008
Posts: 29

Original Poster
Rep: Reputation: 15
D'oh... an empty shell script by the same name was in my home bin directory Thanks for the suggestion.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full Path Verbal Kint Linux - General 7 01-30-2008 09:34 PM
Need to specify the full URL path.. Why? soichih Linux - Networking 3 07-31-2004 08:37 AM
get full path of a command (in C) Hady Programming 9 11-21-2003 10:50 AM
get full path of a command (in C) Hady Linux - Software 1 11-19-2003 05:46 PM
Full Path problems chedmaster Linux - Newbie 1 06-26-2003 10:24 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration