Index: /BAORadio/AmasNancay/trunk/anacalibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/anacalibmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/anacalibmaker.sh	(revision 579)
@@ -83,15 +83,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
 fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/anagainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/anagainmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/anagainmaker.sh	(revision 579)
@@ -83,15 +83,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;   
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
+fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/anarawonoffmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/anarawonoffmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/anarawonoffmaker.sh	(revision 579)
@@ -79,15 +79,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
 fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/calibmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/calibmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/calibmaker.sh	(revision 579)
@@ -81,15 +81,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
 fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/gainmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/gainmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/gainmaker.sh	(revision 579)
@@ -79,15 +79,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;   
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
+fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/getAnalyseFiles.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/getAnalyseFiles.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/getAnalyseFiles.sh	(revision 579)
@@ -77,11 +77,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/getscafiles.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/getscafiles.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/getscafiles.sh	(revision 579)
@@ -22,6 +22,4 @@
   $ECHO "usage: ${script
 Name} <source:ex. Abell85> <date:YYYYMMDD>"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/getscafiles.finished
   exit 0
 fi
@@ -46,15 +44,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
- iojobpath=${TMPBATCH}
-else
-   $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#   touch ${tmppublicpath}/getscafiles.finished
-   exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -84,6 +73,4 @@
 #     $RM ${tmppublicpath}/statusdaq.finished
     $ECHO "FATAL (${scriptName}): ${OUT1} is missing or not readable..."
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getscafiles.finished
     exit 1
 fi
@@ -93,6 +80,4 @@
 if [ "<${nfiles}>" = "<>" ]; then
     $ECHO "FATAL (${scriptName}): No run found for <${sourceRadio}> and date <${dateDAQ}>"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getscafiles.finished
     exit 1
 fi
@@ -116,6 +101,4 @@
 if [ "<$status>" != "<>" ]; then
     $ECHO "FATAL (${scriptName}): connot proceed further with $sourceRadio $dateDAQ"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getscafiles.finished
     exit 1
 fi
@@ -153,6 +136,4 @@
   $ECHO "FATAL (${scriptName}): error while iget:"
   $ECHO $igetStatus
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/getscafiles.finished
   exit 1
 fi
@@ -160,4 +141,3 @@
 $RM -f $OUT4
 
-touch ${tmppublicpath}/getscafiles.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/getsignalfiles.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/getsignalfiles.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/getsignalfiles.sh	(revision 579)
@@ -24,6 +24,4 @@
 if [ ! $# = 4 ]; then
   $ECHO "usage: ${scriptName} <source:ex. Abell85> <date:YYYYMMDD> first last"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/getsignalfiles.finished
   exit 0
 fi
@@ -46,15 +44,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-   $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#   touch ${tmppublicpath}/getsignalfiles.finished
-   exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -86,6 +75,4 @@
 #     $RM ${tmppublicpath}/statusdaq.finished
     $ECHO "FATAL (${scriptName}): ${OUT1} is missing or not readable..."
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getsignalfiles.finished
     exit 1
 fi
@@ -95,6 +82,4 @@
     $ECHO "FATAL (${scriptName}): No run found for <${sourceRadio}> and date <${dateDAQ}>"
     $CAT $OUT1
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getsignalfiles.finished
     exit 1
 fi
@@ -104,6 +89,4 @@
 if [ ${firstFile} -gt  ${nfiles} ]; then
     $ECHO "FATAL (${scriptName}): ${firstFile} >  ${nfiles}"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getsignalfiles.finished
     exit 1
 fi
@@ -113,6 +96,4 @@
 if [ ${lastFile} -gt  ${nfiles} ]; then
     $ECHO "FATAL (${scriptName}): ${lastFile} >  ${nfiles}"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getsignalfiles.finished
     exit 1
 fi
@@ -120,6 +101,4 @@
 if [ ${firstFile} -gt  ${lastFile} ]; then
     $ECHO "FATAL (${scriptName}): ${firstFile} >  ${lastFile}"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/getsignalfiles.finished
     exit 1
 fi
@@ -143,6 +122,4 @@
        $ECHO "FATAL (${scriptName}): error while iget:"
        $ECHO $igetStatus
-#JEC 29/9/11 avoid finished stuff
-#       touch ${tmppublicpath}/getsignalfiles.finished
        exit 1
    fi
@@ -152,6 +129,4 @@
        $ECHO "FATAL (${scriptName}): error while iget:"
        $ECHO $igetStatus
-#JEC 29/9/11 avoid finished stuff
-#       touch ${tmppublicpath}/getsignalfiles.finished
        exit 1
    fi
@@ -159,5 +134,3 @@
 done
 
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/getsignalfiles.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/hdrfitsextractor.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/hdrfitsextractor.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/hdrfitsextractor.sh	(revision 579)
@@ -28,13 +28,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/mkarchive.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/mkarchive.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/mkarchive.sh	(revision 579)
@@ -87,11 +87,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/onoffmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/onoffmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/onoffmaker.sh	(revision 579)
@@ -81,15 +81,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
 fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/proc_script.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/proc_script.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/proc_script.sh	(revision 579)
@@ -39,5 +39,4 @@
 if [ ! $# = 3 ]; then
   usage
-  touch proc_script.finished
   exit 1
 fi
@@ -56,14 +55,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    touch ${tmppublicpath}/proc_script.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -102,5 +93,4 @@
   $CAT ${OUT1}
   $ECHO "DEBUG (${scriptName}): END"
-  touch ${tmppublicpath}/proc_script.finished
   exit 1
 fi
@@ -113,5 +103,4 @@
   $CAT ${OUT1}
   $ECHO "DEBUG (${scriptName}): END"
-  touch ${tmppublicpath}/proc_script.finished
   exit 1
 fi
@@ -147,5 +136,4 @@
 	  $ECHO "FATAL (${scriptName}): error while iget:"
 	  $ECHO $igetStatus
-	  touch ${tmppublicpath}/proc_script.finished
 	  exit 1
       fi
@@ -187,5 +175,4 @@
 if [ ${#cycleArray[*]} -eq 0 -o ${#filesArray[*]} -eq 0 ]; then
    $ECHO "FATAL (${scriptName}): no header file selected (${#cycleArray[*]}, ${#filesArray[*]})"
-   touch ${tmppublicpath}/proc_script.finished
    exit 1
 else
@@ -284,5 +271,4 @@
     $ECHO "FATAL (${scriptName}): type of processing"
     usage
-    touch ${tmppublicpath}/proc_script.finished
     exit 1
     ;;
@@ -345,5 +331,4 @@
 if [ ! -e $prg ]; then
     $ECHO "FATAL (${scriptName}): $prg not found"
-    touch ${tmppublicpath}/proc_script.finished
     exit 1
 fi
@@ -431,5 +416,4 @@
 	    $ECHO "FATAL (\${scriptName}): error while iget:"
 	    $ECHO \$igetStatus
-	    touch ${tmppublicpath}/${jobBatchName}.finished
 	    exit 1
 	fi
@@ -451,5 +435,4 @@
 	$ECHO "FATAL (\${scriptName}): error while get signals"
 	$ECHO \$getSignals
-	touch ${tmppublicpath}/${jobBatchName}.finished
 	exit 1
     fi
@@ -483,5 +466,4 @@
     $RM -f \${iojobpath}/\${localpath}/Fiber1/signal*.fits
     $RM -f \${iojobpath}/\${localpath}/Fiber2/signal*.fits
-    touch ${tmppublicpath}/${jobBatchName}.finished
     exit 0
 EOF
@@ -514,4 +496,3 @@
 $ECHO "DEBUG (${scriptName}): END loop on cycles"
 #
-touch ${tmppublicpath}/proc_script.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/proc_specmfib.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/proc_specmfib.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/proc_specmfib.sh	(revision 579)
@@ -114,14 +114,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    touch ${tmppublicpath}/proc_script.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -161,6 +153,4 @@
   $CAT ${OUT1}
   $ECHO "DEBUG (${scriptName}): END"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/proc_script.finished
   exit 1
 fi
@@ -173,6 +163,4 @@
   $CAT ${OUT1}
   $ECHO "DEBUG (${scriptName}): END"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/proc_script.finished
   exit 1
 fi
@@ -208,6 +196,4 @@
 	  $ECHO "FATAL (${scriptName}): error while iget:"
 	  $ECHO $igetStatus
-#JEC 29/9/11 avoid finished stuff
-#	  touch ${tmppublicpath}/proc_script.finished
 	  exit 1
       fi
@@ -250,6 +236,4 @@
 if [ ${#cycleArray[*]} -eq 0 -o ${#filesArray[*]} -eq 0 ]; then
    $ECHO "FATAL (${scriptName}): no header file selected (${#cycleArray[*]}, ${#filesArray[*]})"
-#JEC 29/9/11 avoid finished stuff
-#   touch ${tmppublicpath}/proc_script.finished
    exit 1
 else
@@ -374,6 +358,4 @@
     $ECHO "FATAL (${scriptName}): type of processing"
     usage
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/proc_script.finished
     exit 1
     ;;
@@ -436,6 +418,4 @@
 if [ ! -e $prg ]; then
     $ECHO "FATAL (${scriptName}): $prg not found"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/proc_script.finished
     exit 1
 fi
@@ -467,6 +447,4 @@
 	$ECHO "FATAL (${scriptName}): error while iget:"
 	$ECHO $igetStatus
-#JEC 29/9/11 avoid finished stuff
-#	touch ${tmppublicpath}/${jobBatchName}.finished
 	exit 1
     fi
@@ -545,6 +523,4 @@
 	$ECHO "FATAL (${scriptName}): error while get signals"
 	$ECHO $getSignals
-#JEC 29/9/11 avoid finished stuff
-#	touch ${tmppublicpath}/${jobBatchName}.finished
 	exit 1
     fi
@@ -588,6 +564,4 @@
 #
 $ECHO "DEBUG (${scriptName}): END loop on cycles"
-#
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/proc_script.finished
+
 exit 0
Index: /BAORadio/AmasNancay/trunk/rawonoffmaker.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/rawonoffmaker.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/rawonoffmaker.sh	(revision 579)
@@ -79,15 +79,13 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-    $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
-    exit 0;
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
+. ${SCRIPTPATH}/isInteractive.sh
+isInteractive=$(isInteractive)
+if [ ${isInteractive} == "1" ]; then
+  $ECHO "Usage in INTERACTIVE may be destructive... To be used with great care !!!!"
+   exit 0;
 fi
+
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/sca.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/sca.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/sca.sh	(revision 579)
@@ -36,15 +36,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/sca.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -53,6 +44,4 @@
     then
     $ECHO "FATAL  (${scriptName}): usage: ./sca.sh <file>"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/sca.finished
     exit 1
 fi
@@ -63,6 +52,4 @@
     then
     $ECHO "FATAL (${scriptName}): $fullfile not found: FATAL"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/sca.finished
     exit 1
 fi
@@ -174,6 +161,4 @@
 $RM $OUT2
 
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/sca.finished
 exit 0
 
Index: /BAORadio/AmasNancay/trunk/scaIsOk.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/scaIsOk.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/scaIsOk.sh	(revision 579)
@@ -33,14 +33,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    touch ${tmppublicpath}/scaIsOk.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -65,5 +57,4 @@
 if [ ! -e ${OUT1} -o ! -r ${OUT1} ]; then
     $ECHO "FATAL (${scriptName}): ${OUT1} is missing or not readable..."
-#    touch ${tmppublicpath}/scaIsOk.finished
     exit 1
 fi
Index: /BAORadio/AmasNancay/trunk/scaextractor.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/scaextractor.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/scaextractor.sh	(revision 579)
@@ -36,15 +36,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/scaextractor.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -140,6 +131,3 @@
 done
 
-
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/scaextractor.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/select.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/select.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/select.sh	(revision 579)
@@ -26,6 +26,4 @@
 if [ ! $# = 3 ]; then
   $ECHO "usage: ${scriptName} <scaXYZ.sum> <signalXYZDirectory> <type of phase:ON|OFF|CALIBON|CALIBOFF>"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/select.finished
   exit 0
 fi
@@ -49,6 +47,4 @@
 if [ ! -e $inScaFile ]; then
   $ECHO "FATAL (${scriptName}): $inScaFile not found"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/select.finished
   exit 1
 fi
@@ -71,6 +67,4 @@
     *) 
     $ECHO "FATAL (${scriptName}): use ON|OFF|CALIBON|CALIBOFF phase tags."
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/select.finished
     exit 1
     ;;
@@ -227,5 +221,3 @@
 $RM $OUT2
 
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/select.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/statusCycles.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusCycles.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statusCycles.sh	(revision 579)
@@ -41,14 +41,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    touch ${tmppublicpath}/statusdaq.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath) 
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/statuscalib.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statuscalib.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statuscalib.sh	(revision 579)
@@ -24,13 +24,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/statusdaq.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusdaq.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statusdaq.sh	(revision 579)
@@ -31,15 +31,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/statusdaq.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
@@ -86,5 +77,3 @@
 done
 
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/statusdaq.finished
 exit 0
Index: /BAORadio/AmasNancay/trunk/statusgain.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusgain.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statusgain.sh	(revision 579)
@@ -24,13 +24,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/statusheader.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusheader.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statusheader.sh	(revision 579)
@@ -24,13 +24,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/statusonoff.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/statusonoff.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/statusonoff.sh	(revision 579)
@@ -24,13 +24,6 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} == "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} == "BATCH" ] ; then
-    iojobpath=${TMPBATCH}
-else
-    $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
Index: /BAORadio/AmasNancay/trunk/transdate.sh
===================================================================
--- /BAORadio/AmasNancay/trunk/transdate.sh	(revision 578)
+++ /BAORadio/AmasNancay/trunk/transdate.sh	(revision 579)
@@ -26,21 +26,10 @@
 
 #Path where the job will do temporary IO
-if [ ${ENVIRONMENT} = "INTERACTIVE" ]; then
-    iojobpath="/sps/baoradio/AmasNancay/JEC"
-    $MKDIR -p $iojobpath
-elif [ ${ENVIRONMENT} = "BATCH" ] ; then
-     iojobpath=${TMPBATCH}
-else
-     $ECHO "FATAL (${scriptName}): environment is ${ENVIRONMENT} not allowed"
-#JEC 29/9/11 avoid finished stuff
-#    touch ${tmppublicpath}/transdate.finished
-    exit 1
-fi
+. ${SCRIPTPATH}/set_iojobpath.sh
+iojobpath=$(set_iojobpath)
 cd ${iojobpath}
 
 if [ ! $# = 1 ]; then
   $ECHO "FATAL (${scriptName}) usage: ./transdate.sh <scaXYZ.sum>"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/transdate.finished
   exit 0
 fi
@@ -50,6 +39,4 @@
 if [ ! -e $inScaFile ]; then
   $ECHO "FATAL (${scriptName}): $inScaFile not found"
-#JEC 29/9/11 avoid finished stuff
-#  touch ${tmppublicpath}/transdate.finished
   exit 1
 fi
@@ -79,5 +66,3 @@
 ' $inScaFile >> $inScaFile.trans
 
-#JEC 29/9/11 avoid finished stuff
-#touch ${tmppublicpath}/transdate.finished
 exit 0
