LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-28-2006, 03:39 AM   #1
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL 6.x, 5.x, Fedora 20, Kubuntu 12.04, Solaris 10,8
Posts: 321

Rep: Reputation: 17
sed matching an apostrophe


Hi there,

I'd like to figure out to get sed to match an apostrophe.

I am trying the following which does'nt match.

It's my understanding the 048 is the ascii code for an apostrophe but this may be wrong.

~> echo "abc'" | sed 's/'`echo "\048"`'/xyz/g'
abc'

Would appreciate some tips. I took a look in the sed faq and some others places and I can't find the answer.

Thanks.
 
Old 04-28-2006, 03:50 AM   #2
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL 6.x, 5.x, Fedora 20, Kubuntu 12.04, Solaris 10,8
Posts: 321

Original Poster
Rep: Reputation: 17
~> echo "abc'" | sed 's/'"'"'/xyz/g'
abcxyz

lol that did it :-)
 
Old 04-28-2006, 05:24 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
echo "abc'" | sed "s/'/xyz/g"

;}


Cheers,
Tink
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 8 12-18-2013 05:36 PM
sed/awk for matching & substituition laikos Programming 3 11-22-2006 11:44 AM
Apostrophe Not Displaying Correctly On Webpage justanothersteve Linux - General 4 02-20-2006 09:43 AM
Quote/Apostrophe Key JordanF Linux - General 1 08-11-2005 02:52 PM
Linux man pages apostrophe problem??? Ynog Linux - General 1 01-07-2004 02:34 PM


All times are GMT -5. The time now is 05:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration