Tim Greer
2/5/2009 9:18:00 PM
James Byrne wrote:
> This is the problem:
>
> irb(main):002:0> x = '--rails --exclude something_is_not_right
> \/usr\/lib,test\/lib'
> => "--rails --exclude something_is_not_right \\/usr\\/lib,test\\/lib"
>
> irb(main):004:0> p x
> "--rails --exclude something_is_not_right \\/usr\\/lib,test\\/lib"
>
> How do I get a literal string like /usr\/lib,test\/lib into a
> variable? Where are these extra '\' artifacts coming from?
You have it right, it's just irb that backwacks it in response.
irb(main):004:0> x = '--rails -exclude something_is_not_right
\/usr\/lib,test\/lib'
=> "--rails -exclude something_is_not_right \\/usr\\/lib,test\\/lib"
irb(main):005:0> puts x
--rails -exclude something_is_not_right \/usr\/lib,test\/lib
=> nil
irb(main):006:0>
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!