The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
read a variable character by character, substitute characters with something else vipervenom25 UNIX for Dummies Questions & Answers 2 06-06-2008 12:18 PM
Minicom runscript: How to send escape character ( \ ) rkhanna Shell Programming and Scripting 0 03-05-2008 02:17 PM
awk / escape character OFFSIHR Shell Programming and Scripting 8 11-29-2006 09:28 AM
Escape character in vi? stevefox Shell Programming and Scripting 4 11-17-2005 11:38 AM
possible to escape the \ character in sed? gammaman UNIX for Dummies Questions & Answers 1 07-07-2005 11:49 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2007
Registered User
 

Join Date: Feb 2007
Posts: 9
Escape character

Hi ,
I want to change space to ' in my script.
I tried doing this,

sed 's/ /\'/g' filename

but i could not get it.
can some one help me please.
Thanks,
Deepak
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-15-2007
andryk's Avatar
Registered User
 

Join Date: Sep 2003
Posts: 448
try the double quote
Code:
sed -e "s/ /\'/g" file
Reply With Quote
  #3 (permalink)  
Old 02-15-2007
Registered User
 

Join Date: Jun 2006
Location: Delhi, India
Posts: 86
sed "s/ /'/g" filename works for me.
Reply With Quote
  #4 (permalink)  
Old 02-15-2007
Registered User
 

Join Date: Feb 2007
Posts: 9
Quote:
Originally Posted by andryk
try the double quote
Code:
sed -e "s/ /\'/g" file
Thanks Andryk.
It worked
Reply With Quote
  #5 (permalink)  
Old 02-15-2007
Registered User
 

Join Date: Feb 2007
Posts: 9
Thanks Vish.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0