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
regexp help TinCanFury Shell Programming and Scripting 0 04-06-2008 07:21 PM
In Help, Substitute Text ... solidhelix08 Shell Programming and Scripting 6 02-07-2008 05:21 AM
regexp with sed again!!! andy2000 Shell Programming and Scripting 2 05-03-2007 11:15 AM
Substitute in vi kingdbag UNIX for Dummies Questions & Answers 5 01-17-2007 02:42 PM
regexp penfold UNIX for Advanced & Expert Users 1 06-28-2005 08:45 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 12-10-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
I think I'd rather use sed than vi

Code:
sed "/blabla\ 'toto'\ rep:\/titi\/toto\//d" infile > outfile

Notice that quoting and escapes have changed here...

Cheers
ZB
  #2 (permalink)  
Old 12-10-2004
Lomic Lomic is offline
Registered User
  
 

Join Date: Dec 2004
Location: Paris
Posts: 20
Quote:
Originally posted by zazzybob
I think I'd rather use sed than vi

Code:
sed "/blabla\ 'toto'\ rep:\/titi\/toto\//d" infile > outfile

Notice that quoting and escapes have changed here...
ok, and like this, is it ok for the allways unknown start of the line (*) ?

and is it possible without trouble that infile=outfile?
  #3 (permalink)  
Old 12-10-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Yes, you can add metacharacters such as

sed "/^.*blabla\ 'toto'\ rep:\/titi\/toto\/.*$/d" infile > outfile

Also; you can use the -i flag to sed if your version supports it to edit the file in-place, although I personally wouldn't recommend it - at least this way with redirection you keep your original intact incase you form your "sed" badly and ruin the file!

Cheers
ZB
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0