LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-24-2011, 07:44 PM   #1
wskibum
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
Using sed to replace special characters in a file


I have a file with special characters that need to be replaced. Any help would be appreciated. I've been working on this for a day and have run out of time.

Example:
FILE='/var/tmp/S0000000.LOG.March-24-2011:10:51.tar'

Need to replace the ' with a " on all lines in the file.

Thanks
 
Old 03-24-2011, 08:37 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi,

try this
Code:
sed "s/'/\"/g" file
 
1 members found this post helpful.
Old 03-24-2011, 09:47 PM   #3
wskibum
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Worked perfectly.
Thank you so much for your help.
 
  


Reply

Tags
replacement, sed


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
[SOLVED] replace new line with <br /> & escape special characters ted_chou12 Linux - Newbie 5 02-07-2011 07:24 PM
search and replace string having multiple special characters say_hi_ravi Linux - Newbie 4 08-26-2009 07:43 AM
How do I replace special characters in a string within a bash script? rhaup0317 Linux - Newbie 2 06-03-2008 11:56 AM
Help w/ sed parsing special characters clem_c_rock General 8 08-31-2007 04:06 PM
using sed to insert lines with special characters disorderly Linux - Software 26 04-20-2006 05:30 PM


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

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