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 09:57 PM
What’s wrong with the following? vrn UNIX for Dummies Questions & Answers 8 03-19-2006 05:09 PM
where have i gone wrong? Blip Shell Programming and Scripting 3 01-28-2004 12:43 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
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 (permalink)  
Old 02-05-2008
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,502
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 (permalink)  
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 (permalink)  
Old 02-06-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,491
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 UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:44 PM.


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

Content Relevant URLs by vBSEO 3.2.0