The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Backslash in find command findprakash UNIX for Dummies Questions & Answers 1 08-24-2008 10:43 AM
Sed and awk backslash characters potro Shell Programming and Scripting 7 05-19-2008 05:34 AM
How to handle backslash in grep string rajbal UNIX for Advanced & Expert Users 6 06-18-2007 05:22 PM
How ro handle backslash character in grep? rajbal Shell Programming and Scripting 1 06-18-2007 05:19 PM
backslash issues Bab00shka UNIX for Dummies Questions & Answers 5 07-09-2004 05:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 10-06-2008
Registered User
 

Join Date: Oct 2008
Location: St. Louis, MO
Posts: 10
I played around with it a bit, and the only way I could get the original varialbe to set properly was to set it like this:

var="c:\\\ndm\stores"

I got the "command garbled" error you're getting, but only when stuffing the results of the echo|sed command into a variable. If I just run that one on the command line against the variable, I get no error. I don't know what's different, though. Possibly, sed doesn't like the back-ticked environment of the script command.
Reply With Quote
Forum Sponsor
  #9  
Old 10-06-2008
Registered User
 

Join Date: Oct 2008
Posts: 20
Anyway to assign it to a variable?
Reply With Quote
  #10  
Old 10-07-2008
Registered User
 

Join Date: Mar 2008
Posts: 107
How about avoiding echo? Note the single quotes to stop shell interpreting \ .

var='c:\dir1\dir2\name'
cat <<EOF
$var
EOF

Output is:
c:\dir1\dir2\name
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 10:11 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