The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sth wrong of gcc zither AIX 2 01-01-2008 10:57 PM
What’s wrong with the following? vrn UNIX for Dummies Questions & Answers 8 03-19-2006 06:09 PM
where have i gone wrong? Blip Shell Programming and Scripting 3 01-28-2004 01:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-05-2008
cleansing_flame's Avatar
Registered User
 

Join Date: Nov 2007
Location: NYC
Posts: 37
what is wrong with this tr -d?

here is my command in bash shell on Mac OS X tiger:

history | tr -d emacs

here is what I get:

hitory | grp "" | tr -d ""
hitory | grp "" | tr -d """"
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ''
hitory | grp "" | tr -d ``
hitory | grp "" | tr -d ""
hitory | grp "" | tr -d ""
hitory | grp "" | tr -d ""
hitory | grp "" | tr -d ""

sadly it removed all ascii characters contained within "emacs", any help appreciated
Reply With Quote
Forum Sponsor
  #2  
Old 02-05-2008
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,638
You have misunderstood the use of tr, which will interpret the laetters as a list oc characters to delete. If I have understood what you want correctly, replacing the tr with this should work:

Code:
sed 's/emacs//'
Reply With Quote
  #3  
Old 02-05-2008
cleansing_flame's Avatar
Registered User
 

Join Date: Nov 2007
Location: NYC
Posts: 37
thanks, but sadly that didn't work either
Reply With Quote
  #4  
Old 02-06-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,297
reborg means to pipe history into sed:
Code:
history | sed 's/emacs//'
What are you trying to do, exactly, not how you think it should be done?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0