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
Running a String as a command, zsh. drnkhmlck Shell Programming and Scripting 2 04-03-2008 11:21 AM
Running two command at the same time Orbix UNIX for Dummies Questions & Answers 10 11-27-2007 01:04 AM
Running command inside awk Raghuram.P Shell Programming and Scripting 1 08-09-2007 02:54 AM
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05:26 AM
running command more than twice in one second? Terrible Shell Programming and Scripting 4 12-10-2006 09:45 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-17-2008
Registered User
 

Join Date: Apr 2008
Posts: 12
sed command not running

I am using solrais 10 on sun sparc.

The following command executes successfully
Code:
echo c:/test.txt | sed -e 's/\//\\\//g'
But when i executes the following command
Code:
x=`echo c:/test.txt | sed -e 's/\//\\\//g'`
I get the following error
Code:
sed: command garbled: s/\//\\//g
Is there any way to avoid this error. I am using the Bash shell.

Last edited by Yogesh Sawant; 04-17-2008 at 06:05 AM. Reason: added code tags
Reply With Quote
Forum Sponsor
  #2  
Old 04-17-2008
Tytalus's Avatar
Registered User
 

Join Date: Jun 2003
Location: Scotland
Posts: 286
one way:

Code:
#  x=`echo c:/test.txt | sed -e 's/\\//\\\\\//g'`

#  echo $x
c:\/test.txt

Last edited by Tytalus; 04-17-2008 at 06:23 AM. Reason: copy / paste :-)
Reply With Quote
  #3  
Old 04-17-2008
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
what is it that you're trying to achieve?
Reply With Quote
  #4  
Old 04-17-2008
Registered User
 

Join Date: Apr 2008
Posts: 12
thanks for reply

Thanks all of you for helping me.

>what is it that you're trying to achieve?

Actually, i am to pass the output of this command to SED to replace a variable PATH with the output of this command.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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


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