only escape if the command contains a space
authorDon Armstrong <don@donarmstrong.com>
Fri, 8 Jul 2016 20:09:15 +0000 (13:09 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 8 Jul 2016 20:09:15 +0000 (13:09 -0700)
dqsub

diff --git a/dqsub b/dqsub
index 3d6f6f7..1682d05 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -260,7 +260,7 @@ sub write_qsub_script {
     my ($opt,$arg,$array) = @_;
 
     my $script = "#!/bin/bash\n";
-    my $command = join(' ',map {qq('$_')} @{$arg});
+    my $command = join(' ',map {$_ =~ /\s/?qq('$_'):$_} @{$arg});
         $script .= <<EOF;
 # this script was written by dqsub
 EOF