Index: trunk/Mars/fact/analysis/gain/fit.sh
===================================================================
--- trunk/Mars/fact/analysis/gain/fit.sh	(revision 17075)
+++ trunk/Mars/fact/analysis/gain/fit.sh	(revision 17159)
@@ -1,2 +1,4 @@
+#!/bin/bash
+
 inpath=$PWD/$1
 outpath=${inpath}/fit
@@ -4,7 +6,8 @@
 
 mkdir -p $outpath
+cp ${macro} ${outpath}
 
-files_out=`ls -1 ${inpath}  | grep \.root`
-files_fit=`ls -1 ${outpath} | grep \.root`
+files_out=`ls -1r ${inpath}  | grep \.root`
+files_fit=`ls -1r ${outpath} | grep \.root`
 
 for file in $files_out
