Index: /trunk/ippScripts/scripts/detrend_norm_apply.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 10700)
@@ -123,3 +123,8 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
Index: /trunk/ippScripts/scripts/detrend_norm_calc.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 10700)
@@ -158,3 +158,8 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
Index: /trunk/ippScripts/scripts/detrend_norm_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 10700)
@@ -147,5 +147,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 10700)
@@ -147,5 +147,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 10700)
@@ -128,5 +128,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_reject_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 10700)
@@ -215,5 +215,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 # Retrieve the requested rejection limit, dying if not extant
Index: /trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 10700)
@@ -247,5 +247,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 
Index: /trunk/ippScripts/scripts/detrend_stack.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_stack.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/detrend_stack.pl	(revision 10700)
@@ -133,5 +133,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippScripts/scripts/inject.pl
===================================================================
--- /trunk/ippScripts/scripts/inject.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/inject.pl	(revision 10700)
@@ -128,4 +128,11 @@
 }
 
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
+
 
 __END__
Index: /trunk/ippScripts/scripts/mdc2list.pl
===================================================================
--- /trunk/ippScripts/scripts/mdc2list.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/mdc2list.pl	(revision 10700)
@@ -70,3 +70,8 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
Index: /trunk/ippScripts/scripts/phase2.pl
===================================================================
--- /trunk/ippScripts/scripts/phase2.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/phase2.pl	(revision 10700)
@@ -112,5 +112,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippScripts/scripts/phase3.pl
===================================================================
--- /trunk/ippScripts/scripts/phase3.pl	(revision 10699)
+++ /trunk/ippScripts/scripts/phase3.pl	(revision 10700)
@@ -152,5 +152,10 @@
 }
 
-END { system("sync") == 0 or die "failed to execute sync: $!" }
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
 
 __END__
Index: /trunk/ippTools/scripts/dettest.sh
===================================================================
--- /trunk/ippTools/scripts/dettest.sh	(revision 10699)
+++ /trunk/ippTools/scripts/dettest.sh	(revision 10700)
@@ -8,14 +8,16 @@
 
 #dettool -definebyquery -det_type flat -set_exp_type fooflat -set_filter foo -set_airmass 10 -set_exp_time 30.0 -set_ccd_temp 100 -set_posang 360 -set_object iobject || exit 1
-dettool -definebyquery -det_type flat -set_exp_type fooflat -set_filter foo -set_airmass 10 -set_exp_time 30.0 -set_object iobject || exit 1
+det_id=`dettool -definebyquery -det_type flat -set_exp_type fooflat -set_filter foo -set_airmass 10 -set_exp_time 30.0 -set_object iobject -simple | cut -f1 -d" "` || exit 1
+
 dettool -raw || exit 1
 
 for ID in `seq 0 3` ; do
-    dettool -addprocessedimfile -det_id $det_id -exp_tag t10 -class_id $ID -uri file://proc-$ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 || exit 1
+    dettool -addprocessedimfile -det_id $det_id -exp_tag t11.2 -class_id $ID -uri file://proc-$ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 || exit 1
 done;
 
-for ID in `seq 0 3` ; do
-    dettool -addprocessedimfile -det_id $det_id -exp_tag t11 -class_id $ID -uri file://proc-$ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 || exit 1
-done;
+#for ID in `seq 0 3` ; do
+#    dettool -addprocessedimfile -det_id $det_id -exp_tag t11 -class_id $ID -uri file://proc-$ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 || exit 1
+#done;
+
 
 dettool -tostacked || exit 1
@@ -42,19 +44,16 @@
 
 for ID in `seq 0 3` ; do
-    dettool -addresidimfile -det_id $det_id -exp_tag t10 -class_id $ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 -uri file://resid-$ID || exit 1
-done;
-for ID in `seq 0 3` ; do
-    dettool -addresidimfile -det_id $det_id -exp_tag t11 -class_id $ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 -uri file://resid-$ID || exit 1
+    dettool -addresidimfile -det_id $det_id -exp_tag t11.2 -class_id $ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 -uri file://resid-$ID || exit 1
 done;
 
 dettool -toresidexp || exit 1
-dettool -addresidexp -det_id $det_id -exp_tag t10 -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri jpeg1 -b2_uri jpeg2  || exit 1
-dettool -addresidexp -det_id $det_id -exp_tag t11 -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri jpeg1 -b2_uri jpeg2  -reject || exit 1
+dettool -addresidexp -det_id $det_id -exp_tag t11.2 -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri jpeg1 -b2_uri jpeg2  || exit 1
+#dettool -addresidexp -det_id $det_id -exp_tag t11.2 -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri jpeg1 -b2_uri jpeg2  -reject || exit 1
 
 dettool -residdetrun || exit 1
 dettool -residexp || exit 1
 dettool -updateresidexp -det_id $det_id -iteration 0 -recip yourrecipe || exit 1
-dettool -updateresidexp -det_id $det_id -iteration 0 -exp_tag t10 -reject || exit 1
-dettool -updateresidexp -det_id $det_id -iteration 0 -exp_tag t11 || exit 1
+dettool -updateresidexp -det_id $det_id -iteration 0 -exp_tag t11.2 -reject || exit 1
+dettool -updateresidexp -det_id $det_id -iteration 0 -exp_tag t11.2 || exit 1
 
 dettool -adddetrunsummary -det_id $det_id -iteration 0 -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -accept || exit 1
Index: /trunk/ippTools/scripts/regtest.sh
===================================================================
--- /trunk/ippTools/scripts/regtest.sh	(revision 10699)
+++ /trunk/ippTools/scripts/regtest.sh	(revision 10700)
@@ -24,5 +24,5 @@
 done;
 
-$p0tool -updateexp -exp_tag $exp_tag1 -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
+#$p0tool -updateexp -exp_tag $exp_tag1 -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
 
 for ID in `seq 0 3`; do
