Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-28-2011, 12:10 PM   #16
Senior Member
Registered: Jan 2010
Posts: 1,658

Rep: Reputation: 482Reputation: 482Reputation: 482Reputation: 482Reputation: 482

@OP: This is how you can *escape* a single quote inside single quotes in bash:
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:
sed " ... " file
As for your second issue, try putting a backslash '\' after the 'i':
sed 'linenumber i\whatever' file
1 members found this post helpful.
Old 08-28-2011, 04:06 PM   #17
Arvind Shivaramakrishnan
LQ Newbie
Registered: Aug 2011
Posts: 12
Blog Entries: 2

Original Poster
Rep: Reputation: Disabled
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.". Error says command is garbled
Old 08-28-2011, 04:56 PM   #18
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,664

Rep: Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078Reputation: 5078
Originally Posted by Arvind Shivaramakrishnan View Post
im using Solaris10 and this is the version of sed "VERSION: 11.10.0,REV=2005.". Error says command is garbled 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.


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

All times are GMT -5. The time now is 09:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration