Andrew, doubling the backlashes ought to work. The double slashes that are displayed in the "executing" line are an artifact of how Ruby's String#inspect method works--it escapes slashes for display, but there are really only single slashes in the string. In other words:

  s = "\\(DEPLOY\\)"
  puts(s)  #--> \(DEPLOY\)
  puts(s.inspect) #--> "\\(DEPLOY\\)"

Are you getting an error when you use the double backslashes? Or is it just not doing what you are expecting it to do?

- Jamis

On Jan 31, 2008, at 3:25 AM, Andrew McClain wrote:


I can't figure out how to escape backslashes in my run command...

task :flip_deploy_switch, :except => { :no_release => true } do
       run "sed -e 's/^\(DEPLOY =\).*/\1 #{deploy_settings_var}/g'
#{release_path}/settings.py.old > #{release_path}/settings.py"
end

yields

* executing "sed -e 's/^(DEPLOY =).*/\001 True/g' /usr/local/src/ panda-
deploy/releases/20080131100217/settings.py.old > /usr/local/src/panda-
deploy/releases/20080131100217/settings.py"

but escaping the backslashes doesn't work either!

task :flip_deploy_switch, :except => { :no_release => true } do
   run "sed -e 's/^\\(DEPLOY =\\).*/\\1 #{deploy_settings_var}/g'
#{release_path}/settings.py.old > #{release_path}/settings.py"
end

yields
 * executing "sed -e 's/^\\(DEPLOY =\\).*/\\1 True/g' /usr/local/src/
panda-deploy/releases/20080131102405/settings.py.old > /usr/local/src/
panda-deploy/releases/20080131102405/settings.py"

What can I do??
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to