Index: trunk/MagicSoft/Mars/scripts/merppupdate
===================================================================
--- trunk/MagicSoft/Mars/scripts/merppupdate	(revision 8486)
+++ trunk/MagicSoft/Mars/scripts/merppupdate	(revision 8487)
@@ -39,5 +39,35 @@
 outpath=
 
-calfiles=`find $outpath -name 20_*_Y_*_E.root`
+#regular expression for the filename
+name="20*_Y_*E.root"
+
+if ! [ "$1" = "" ]
+then
+   outpath=$1
+   if ! [ "$2" = "" ]
+   then
+      name=$2
+      if ! [ "$3" = "" ]
+      then
+         echo "You gave too many arguments."
+         exit
+      fi
+   fi
+fi
+
+if [ "$outpath" = "" ]
+then 
+   echo "You have to give an outpath."
+   exit
+fi
+
+if ! ls $outpath
+then 
+   echo "Your outpath is not valid."
+   exit
+fi
+   
+
+calfiles=`find $outpath -name '$name'`
 
 echo "calfiles: "$calfiles
