LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, CentOS, Ubuntu
Posts: 333

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, CentOS, Ubuntu
Posts: 333

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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

;}


Cheers,
Tink
 
  


Reply



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 9 06-30-2016 05:30 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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:05 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
Open Source Consulting | Domain Registration