The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
variable redirect messing up a sed command.
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
variable redirect messing up a sed command.
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
05-26-2009
JerryHone
Registered User
Join Date: Nov 2006
Location: UK
Posts: 178
"Cascading backslashes" a.k.a "Leaning toothpicks"!
Code:
var=`echo "Hello\,World" |
sed
's/\\\,/,/'`; echo $var --> "Hello,World"
seems to work!
It's because the backticks are spawning another subshell, but the original backslashes have already been interpreted by the first one.
JerryHone
View Public Profile
Find all posts by JerryHone
Find JerryHone's past nominations received
Find JerryHone's present nominations given