LinuxQuestions.org
Visit Jeremy's Blog.
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 08-28-2011, 01:10 PM   #16
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448

@OP: This is how you can *escape* a single quote inside single quotes in bash:
Code:
'\''
Strictly speaking you are not really escaping it inside single quotes. You simply close the quotes, escape it in bash and then reopen the quote.
Alternatively, you can put your sed commands inside double-quotes. Then you do not have to escape the single quote:
Code:
sed " ... " file
As for your second issue, try putting a backslash '\' after the 'i':
Code:
sed 'linenumber i\whatever' file
 
1 members found this post helpful.
Old 08-28-2011, 05:06 PM   #17
Arvind Shivaramakrishnan
LQ Newbie
 
Registered: Aug 2011
Posts: 11
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Yes, and you were given a solution in the posts above. Re-read them, and it will tell you how to 'escape' a character.

You load the GNU version of sed onto the Solaris box. Since you don't say what version of Solaris, what version of sed is on it, or what errors you're getting, what can anyone tell you?

And again, instead of posting a new "please provide solution for xxxx with sed" question every time, why don't you take the time to LEARN SED?? There are many online tutorials, books, and guides to help you, instead of having others spoon-feed you each answer, because you don't want to learn.
im using Solaris10 and this is the version of sed "VERSION: 11.10.0,REV=2005.01.21.16.34". Error says command is garbled
 
Old 08-28-2011, 05:56 PM   #18
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,919

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by Arvind Shivaramakrishnan View Post
im using Solaris10 and this is the version of sed "VERSION: 11.10.0,REV=2005.01.21.16.34". Error says command is garbled
Ok...so again, install the GNU version of sed from BigAdmin, or download the source and compile it on Solaris, or learn sed and modify your command.
 
  


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
sed search replace tomerbd1 Linux - General 9 04-10-2008 05:31 AM
How do I replace ' with sed.... @ngelot Linux - Newbie 2 11-02-2007 08:04 PM
edit ldap entry philosophia Linux - Newbie 2 05-31-2007 09:07 PM
Need a mod to edit my HCL entry. qwijibow Linux - Hardware 1 01-11-2005 03:38 PM
edit HCL entry? psychobyte LQ Suggestions & Feedback 6 10-29-2004 08:32 AM


All times are GMT -5. The time now is 02:14 PM.

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