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
Questions on GREP command stevefox UNIX for Dummies Questions & Answers 11 12-25-2007 12:48 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-24-2006 09:20 PM
grep questions bobo UNIX for Dummies Questions & Answers 8 07-20-2006 01:20 PM
Simple grep questions nitin UNIX for Dummies Questions & Answers 2 10-14-2001 09:52 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-03-2004
Registered User
 

Join Date: May 2003
Posts: 14
Question Unpratical SED and GREP questions

Hello every one, I have read a little about SED and GREP but I do not know how to do this:

Using SED or GREP:

"reverse all three letter words"
"replace the last two digits in any string of digits by zeros (0)"
"remove lines that start and end with the same word"

and I have more like these but the book just explains the simple stuff.

Thanks in advance.
Forum Sponsor
  #2  
Old 03-03-2004
Registered User
 

Join Date: Feb 2004
Location: netherlands
Posts: 42
This looks like homework, so I'm not going to provide answers.
I do have some links to sed related pages, take a look there.

Sed Tutorials:
http://sed.sourceforge.net/grabbag/tutorials/

The Awful Truth about sed:
http://www.grymoire.com/Unix/Sed.html

sed.sf.net (looks a bit messy, but a lot of info):
http://sed.sourceforge.net/

I bet the answers to all sed related questions are there.

man grep will give you all the info you need for grep related things.

Hope this helps.
__________________

The dead stay dead and the living only wait to join them........
  #3  
Old 03-03-2004
Registered User
 

Join Date: May 2003
Posts: 14
Smile

No is not homework. These are questions from past midterms where 30 became "C"s in one nasty curve.

Thanks for the links!!!
  #4  
Old 03-03-2004
Registered User
 

Join Date: May 2003
Posts: 14
Lightbulb

Is there a fast and dirty way to use all these commands.

Thanks!!!
  #5  
Old 03-03-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
The rule is:
(6) Do not post classroom or homework problems.

I don't see an exception for questions from past midterms.
  #6  
Old 03-03-2004
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
Re: Unpratical SED and GREP questions

"remove lines that start and end with the same word"
awk '$1 != $NF' yourFile > newFile

As you can see, these aren't necessarily "tough" examples.

You must've picked up a very general book if it doesn't talk about how to do if/else statements with awk and sed.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:51 AM.


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