<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *SVN*
 
+* Set :shell to false to run a command without wrapping it in &quot;sh -c&quot; [Jamis Buck]
+
 * Don't request a pty by default [Jamis Buck]
 
 * Add a &quot;match&quot; remote dependency method [Adam Greene]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -86,8 +86,18 @@ module Capistrano
 
             execute_command = Proc.new do |ch|
               logger.trace &quot;executing command&quot;, ch[:server] if logger
-              escaped = replace_placeholders(command, ch).gsub(/[$\\`&quot;]/) { |m| &quot;\\#{m}&quot; }
-              command_line = [environment, options[:shell] || &quot;sh&quot;, &quot;-c&quot;, &quot;\&quot;#{escaped}\&quot;&quot;].compact.join(&quot; &quot;)
+              cmd = replace_placeholders(command, ch)
+
+              if options[:shell] == false
+                shell = nil
+              else
+                shell = &quot;#{options[:shell] || &quot;sh&quot;} -c&quot;
+                cmd = cmd.gsub(/[$\\`&quot;]/) { |m| &quot;\\#{m}&quot; }
+                cmd = &quot;\&quot;#{cmd}\&quot;&quot;
+              end
+
+              command_line = [environment, shell, cmd].compact.join(&quot; &quot;)
+
               ch.exec(command_line)
               ch.send_data(options[:data]) if options[:data]
             end</diff>
      <filename>lib/capistrano/command.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,6 +112,13 @@ class CommandTest &lt; Test::Unit::TestCase
     Capistrano::Command.new(&quot;ls&quot;, [session], :shell =&gt; &quot;/bin/bash&quot;)
   end
 
+  def test_successful_channel_with_shell_false_should_send_command_without_shell
+    session = setup_for_extracting_channel_action do |ch|
+      ch.expects(:exec).with(%(echo `hostname`))
+    end
+    Capistrano::Command.new(&quot;echo `hostname`&quot;, [session], :shell =&gt; false)
+  end
+
   def test_successful_channel_should_send_data_if_data_key_is_present
     session = setup_for_extracting_channel_action do |ch|
       ch.expects(:exec).with(%(sh -c &quot;ls&quot;))</diff>
      <filename>test/command_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a899eb798e2d32bd1bfc3e3c1f6f9816a8f08613</id>
    </parent>
  </parents>
  <author>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </author>
  <url>http://github.com/jamis/capistrano/commit/ee78acbca63854f7f06f578f75f8604d46572ece</url>
  <id>ee78acbca63854f7f06f578f75f8604d46572ece</id>
  <committed-date>2007-08-31T20:31:53-07:00</committed-date>
  <authored-date>2007-08-31T20:31:53-07:00</authored-date>
  <message>Set :shell to false to run a command without wrapping it in &quot;sh -c&quot; (closes #9290)


git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>d716e8d1abae07e1e5bae666e15f69870caa5905</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
