Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 1596)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 1597)
@@ -6,4 +6,5 @@
 function timer()
 {
+	#if no input: return time, else return elapsed time
 	if [[ $# -eq 0 ]]; then
 		echo $(date '+%s')
@@ -21,9 +22,20 @@
 	fi
 }
-function todaydate()
+function today_date()
 {
-	export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`; 
+	#return today date
 	suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`			 
-	echo $suffix;			 
+	echo $suffix;
+} 
+function host_name()
+{
+	#return host name depending on the OS
+	if [[ "$1" == "winxp32" ]] 
+	then
+		HOST_NAME=`hostname`;
+	else
+		HOST_NAME=`hostname -s`;
+	fi
+	echo $HOST_NAME;
 } 
 
@@ -41,8 +53,10 @@
 
 #create nightly run variables
-export TODAY=$(todaydate);
-export HOST_NAME=`hostname`;
+export TODAY=$(today_date);
+export HOST_NAME=$(host_name $OS);
 export ISSM_RELEASE="issm"
 export OS
+echo $HOST_NAME
+exit
 
 #create ISSM variables
@@ -149,5 +163,5 @@
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
-Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
+Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
 Mime-Version: 1.0
 Content-Type: text/html
@@ -157,5 +171,5 @@
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
-Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
+Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
 Mime-Version: 1.0
 Content-Type: text/html
