Index: /trunk/ippScripts/scripts/detrend_norm_apply.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 9445)
@@ -116,2 +116,4 @@
     unlink $statsName;
 }
+
+END { system("sync") or die "failed to execute sync: $!" }
Index: /trunk/ippScripts/scripts/detrend_norm_calc.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_norm_calc.pl	(revision 9445)
@@ -146,2 +146,4 @@
     }
 }
+
+END { system("sync") or die "failed to execute sync: $!" }
Index: /trunk/ippScripts/scripts/detrend_norm_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_norm_exp.pl	(revision 9445)
@@ -148,4 +148,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 9445)
@@ -146,4 +146,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 9445)
@@ -120,4 +120,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_reject_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_reject_exp.pl	(revision 9445)
@@ -205,3 +205,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
+
 __END__
Index: /trunk/ippScripts/scripts/detrend_reject_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_reject_imfile.pl	(revision 9445)
@@ -222,4 +222,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippScripts/scripts/detrend_resid.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_resid.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_resid.pl	(revision 9445)
@@ -139,3 +139,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
+
 __END__
Index: /trunk/ippScripts/scripts/detrend_stack.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_stack.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/detrend_stack.pl	(revision 9445)
@@ -131,4 +131,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippScripts/scripts/mdc2list.pl
===================================================================
--- /trunk/ippScripts/scripts/mdc2list.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/mdc2list.pl	(revision 9445)
@@ -69,2 +69,4 @@
     return \%hash;
 }
+
+END { system("sync") or die "failed to execute sync: $!" }
Index: /trunk/ippScripts/scripts/phase0_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/phase0_exp.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/phase0_exp.pl	(revision 9445)
@@ -175,2 +175,4 @@
     return $imfile->{$name};
 }
+
+END { system("sync") or die "failed to execute sync: $!" }
Index: /trunk/ippScripts/scripts/phase0_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/phase0_imfile.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/phase0_imfile.pl	(revision 9445)
@@ -124,3 +124,5 @@
 # Pau.
 
+END { system("sync") or die "failed to execute sync: $!" }
+
 __END__
Index: /trunk/ippScripts/scripts/phase2.pl
===================================================================
--- /trunk/ippScripts/scripts/phase2.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/phase2.pl	(revision 9445)
@@ -106,3 +106,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
+
 __END__
Index: /trunk/ippScripts/scripts/phase3.pl
===================================================================
--- /trunk/ippScripts/scripts/phase3.pl	(revision 9444)
+++ /trunk/ippScripts/scripts/phase3.pl	(revision 9445)
@@ -151,4 +151,5 @@
 }
 
+END { system("sync") or die "failed to execute sync: $!" }
 
 __END__
Index: /trunk/ippTools/scripts/dettest.sh
===================================================================
--- /trunk/ippTools/scripts/dettest.sh	(revision 9444)
+++ /trunk/ippTools/scripts/dettest.sh	(revision 9445)
@@ -2,4 +2,6 @@
 
 set -o verbose
+
+det_id=1
 
 ./p0test.sh -detrend || exit 1
@@ -9,9 +11,9 @@
 
 for ID in `seq 0 3` ; do
-    dettool -addprocessedimfile -det_id 1 -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 t10 -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 1 -exp_tag t11 -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 -class_id $ID -uri file://proc-$ID -recip myrecip -bg 1 -bg_stdev 1 -bg_mean_stdev 1 || exit 1
 done;
 
@@ -19,38 +21,38 @@
 
 for ID in `seq 0 3` ; do
-    dettool -addstacked -det_id 1 -uri file://stacked-$ID -class_id $ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 || exit 1
+    dettool -addstacked -det_id $det_id -uri file://stacked-$ID -class_id $ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 || exit 1
 done;
 
 dettool -tonormalizedstat || exit 1
 for ID in `seq 0 3` ; do
-    dettool -addnormalizedstat -det_id 1 -class_id $ID -norm 0.12345 || exit 1
+    dettool -addnormalizedstat -det_id $det_id -class_id $ID -norm 0.12345 || exit 1
 done;
 
 dettool -tonormalize || exit 1
 for ID in `seq 0 3` ; do
-    dettool -addnormalizedimfile -det_id 1 -class_id $ID -uri file://normalized-$ID -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri banana1 -b2_uri banannnnnaaa2 || exit 1
+    dettool -addnormalizedimfile -det_id $det_id -class_id $ID -uri file://normalized-$ID -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri banana1 -b2_uri banannnnnaaa2 || exit 1
 done;
 
 dettool -tonormalizedexp || exit 1
-dettool -addnormalizedexp -det_id 1 -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri file://normalizedexp -b2_uri file://normlalizedexp|| exit 1
+dettool -addnormalizedexp -det_id $det_id -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -b1_uri file://normalizedexp -b2_uri file://normlalizedexp|| exit 1
 
 dettool -toresid || exit 1
 
 for ID in `seq 0 3` ; do
-    dettool -addresidimfile -det_id 1 -exp_tag t10 -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 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 1 -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 -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 1 -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 1 -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 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 -residdetrun || exit 1
 dettool -residexp || exit 1
-dettool -updateresidexp -det_id 1 -iteration 0 -recip yourrecipe || exit 1
-dettool -updateresidexp -det_id 1 -iteration 0 -exp_tag t10 -reject || exit 1
-dettool -updateresidexp -det_id 1 -iteration 0 -exp_tag t11 || 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 -residexp || exit 1
-dettool -updatedetrun -det_id 1 -again || exit 1
+dettool -updatedetrun -det_id $det_id -again || exit 1
