Index: trunk/DataCheck/Sourcefile.sh
===================================================================
--- trunk/DataCheck/Sourcefile.sh	(revision 18322)
+++ trunk/DataCheck/Sourcefile.sh	(revision 18323)
@@ -481,11 +481,27 @@
          ;;
       # certain date
-      [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9])
-         printprocesslog "DEBUG getdates case certain date: "$1
-         dates=( $1 )
+      [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]|[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]-[0-9][0-9][0-9])
+         d=`echo $1 | grep -o [0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`
+         range=`echo $1 | grep -o '[0-9][0-9][0-9]$'`
+         range=`echo $range | sed -e 's/^0//' -e 's/^0//'`
+         printprocesslog "DEBUG getdates - certain date "$d"."
+         dates=( $d )
+         if [ "$range" != "" ]
+         then 
+            printprocesslog "DEBUG getdates - add the last "$range" days."
+            yy=`echo $d | cut -c 1-4`
+            mm=`echo $d | cut -c 6-7`
+            dd=`echo $d | cut -c 9-10`
+            for (( numdates=1 ; numdates <= $range ; numdates++ ))
+            do 
+               numhours=`echo " 12 + ( $numdates - 1 ) * 24 " | bc -l`
+               dates=( ${dates[@]} `date +%Y/%m/%d --date=$yy/$mm/$dd"-"$numhours"hour"` )
+            done
+         fi
          ;;
-      # certain number of dates (between 0 and 99 )
-      [0-9][0-9]|[0-9]|[0-9][0-9][0-9])
+      # certain number of dates (between 0 and 9999)
+      [1-9][0-9][0-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9]|[1-9])
          # get last n nights
+         printprocesslog "DEBUG getdates - get the last "$1" days."
          for (( numdates=1 ; numdates <= $1 ; numdates++ ))
          do 
@@ -500,4 +516,5 @@
             if [ $hour -le $2 ] || [ $hour -ge $3 ]
             then
+               printprocesslog "DEBUG getdates - get the current night."
                dates=( `date +%Y/%m/%d --date="-12hour"` )
             fi
@@ -505,5 +522,5 @@
          ;;
       *) # nothing valid given
-         echo "Please give valid options for the function 'getdates()'"
+         echo "Please give valid option (YYYY/MM/DD[-RRR] or 1-9999)"
          finish
          ;;
