Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Closed Thread
  Search this Thread
Old 05-09-2004, 04:27 AM   #1
Registered: Jul 2003
Location: Istanbul
Distribution: slack
Posts: 43

Rep: Reputation: 15
Thumbs down sed command


i have a file named table .I want to delete the line
which includes '3 mytable' however my sed and tr commands did not do it.My commands are:

sed -e '/3 mytable/d' /home/springer/table

i think this sed command has to delete the line but i did not manage?
Do you have any idea.? I also try this with tr command but it did'nt work too.

I have blank between 3 and mytable and after mytable there is nothing.
Old 05-09-2004, 06:32 AM   #2
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
The -e switch assumes you want to add a script to the commands to be executed. A simpler way to do it is this: sed '/3 mytable/d' table > newtable
This will create a new file called "newtable" will all the contents from the original "table" file but without the line containing "3 mytable".

Check the very useful Seder's grab-bag for useful examples and tutorials.

Old 05-09-2004, 12:58 PM   #3
Senior Member
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

Closed Thread

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
sed command Kalyani1 Linux - Software 28 12-07-2005 11:48 AM
sed command rharris72 Programming 6 11-20-2005 08:26 PM
sed command linuxdev Linux - Newbie 9 02-24-2004 04:50 PM
sed Command linuxdev Linux - Newbie 3 02-09-2004 11:27 AM
sed command kwigibo Linux - General 3 04-21-2002 04:11 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:31 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
Open Source Consulting | Domain Registration