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
perl split funciton - special character "/" deepakwins UNIX for Dummies Questions & Answers 5 02-07-2008 09:19 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-19-2007 10:52 PM
"sed" to check file size & echo " " to destination file jockey007 Shell Programming and Scripting 6 11-13-2007 06:00 PM
extran NUll character added after end of line "\n" arunkumar_mca UNIX for Dummies Questions & Answers 1 11-12-2007 10:23 AM
deleting newline characters but not the "true" \n character caddyjoe77 Shell Programming and Scripting 1 08-15-2007 07:21 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-11-2006
Registered User
 

Join Date: Dec 2005
Posts: 33
replacing the character "\" in a file

I am using sed to replace things like "," and tabs in a file, but what is the code for replacing a \ ????
Reply With Quote
Forum Sponsor
  #2  
Old 01-11-2006
mona's Avatar
Registered User
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Hope this will help you
Code:
echo "hai \\" | sed 's/\\/replaced/'
Reply With Quote
  #3  
Old 01-11-2006
Registered User
 

Join Date: Dec 2005
Posts: 33
Hi there,
this is what I'm running from the command line

sed -e s/\\/ / TalkTalk5.txt > bob.slash

but I'm still getting a garbed error message. Any ideas ?????
Reply With Quote
  #4  
Old 01-11-2006
mona's Avatar
Registered User
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Quote:
Originally Posted by rjsha1
Hi there,
this is what I'm running from the command line

sed -e s/\\/ / TalkTalk5.txt > bob.slash

but I'm still getting a garbed error message. Any ideas ?????
You are missing single quote. Try this

Code:
sed -e 's/\\/ /'  TalkTalk5.txt > bob.slash
Reply With Quote
  #5  
Old 01-11-2006
Registered User
 

Join Date: Dec 2005
Posts: 33
Cheers mona,
I thought I was going mad - that what happens when you look at the screen for too long
Reply With Quote
  #6  
Old 01-11-2006
mona's Avatar
Registered User
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
It happens
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:58 PM.


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

Content Relevant URLs by vBSEO 3.2.0