LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-27-2014, 02:40 PM   #1
descha
LQ Newbie
 
Registered: May 2014
Posts: 1

Rep: Reputation: Disabled
Smile sed commands-URGENT


I want to substitute part of line in file, from ! to the end of file with string .How can I do that.Thank you
 
Old 05-27-2014, 02:43 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,823
Blog Entries: 1

Rep: Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218
Hi and welcome to LQ.

There's nothing "urgent" to your post - at least not to us - so please do not use this word on this forum. It will not get you preferential treatment.

What have you tried so far? Can you show us the sample line AND the desired output?

Have a look at http://www.grymoire.com/Unix/sed.html - probably the best sed tutorial out there.
 
Old 05-27-2014, 02:52 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,978

Rep: Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311Reputation: 4311
Quote:
Originally Posted by descha View Post
I want to substitute part of line in file, from ! to the end of file with string .How can I do that.Thank you
If this is 'urgent', why did you not attempt to look this up? Since you probably found this site with Google, did you not try to put that question in?? Lots of answers, such as:
Code:
's/<whatever/regex goes here>.*$/<replacement regex>/g'
As sycamorex says, showing effort of your own will likely get you help; showing ZERO effort won't.
 
  


Reply


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
How to use varibles within sed commands simpleman0982 Programming 3 11-07-2010 02:37 AM
need a help in linux commands its urgent help me sarbjeet kaur Linux - Newbie 4 09-22-2009 04:38 PM
how do other commands work with 'sed' sumitdevbharadwaj Linux - General 2 07-29-2009 09:42 AM
Sed commands Gins Programming 13 03-31-2006 02:29 PM
Abut sed and tr commands pazvant Programming 1 05-09-2004 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration