Index: trunk/ippTasks/detrend.reject.pro
===================================================================
--- trunk/ippTasks/detrend.reject.pro	(revision 12368)
+++ trunk/ippTasks/detrend.reject.pro	(revision 12369)
@@ -144,4 +144,9 @@
     exec mkdir -p $outroot
 
+    $run = detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA $ARGS
+    if ($WORKDIR != NULL)
+      $run = $run --workdir $outroot
+    end
+
     # save the pageName for future reference below
     options $pageName
@@ -149,7 +154,7 @@
     # create example job options as a demonstration
     if ($VERBOSE > 1)
-      echo command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA --workdir $outroot $ARGS
+      echo command $run
     end
-    command detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA --workdir $outroot $ARGS
+    command $run
  end
 
