]> git.donarmstrong.com Git - uiuc_igb_scripts.git/commitdiff
sanitize -N
authorDon Armstrong <don@donarmstrong.com>
Fri, 8 Jul 2016 20:00:27 +0000 (13:00 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 8 Jul 2016 20:00:27 +0000 (13:00 -0700)
dqsub

diff --git a/dqsub b/dqsub
index b1d1d0519e0e5b398e0c09ade09fe1491322b47f..eba737308758fdac1c9af77dae886c2cfb5c387b 100755 (executable)
--- a/dqsub
+++ b/dqsub
@@ -150,7 +150,10 @@ if ($options{interactive} and @ARGV) {
 }
 
 # pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
-print STDERR join("\n",@USAGE_ERRORS) and exit 1 if @USAGE_ERRORS;
+if (@USAGE_ERRORS) {
+    print STDERR map {"$_\n"} @USAGE_ERRORS;
+    exit 1;
+}
 
 # OK. Generate the options to qsub which we'll be using
 my @qsub_options = generate_qsub_options(\%options,\@ARGV);
@@ -216,7 +219,9 @@ sub generate_qsub_options{
     if ($options->{name}) {
         push @qo,'-N',$options->{name};
     } else {
-        push @qo,'-N',join('_',@{$args}[0..min($#{$args},2)]);
+        push @qo,'-N',join('_',
+                           map {s/[^a-zA-Z0-9]*//g; $_;}
+                          @{$args}[0..min($#{$args},2)]);
     }
     # join error and output streams
     if ($options->{join}) {