![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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//' |
|
#3
|
||||
|
||||
|
thanks, but sadly that didn't work either
|
|
#4
|
|||
|
|||
|
reborg means to pipe history into sed:
Code:
history | sed 's/emacs//' |
|||
| Google The UNIX and Linux Forums |