Sfoglia il codice sorgente

Fixed use of date() function

Carlos Bautista 12 anni fa
parent
commit
5ff62fefe9
1 ha cambiato i file con 4 aggiunte e 7 eliminazioni
  1. 4 7
      bb.sh

+ 4 - 7
bb.sh

@@ -668,7 +668,9 @@ date_version_detect() {
 	if [ $? -ne 0 ];  then
 	if [ $? -ne 0 ];  then
 		# date utility is BSD. Test if gdate is installed 
 		# date utility is BSD. Test if gdate is installed 
 		if gdate --version >/dev/null 2>&1 ; then
 		if gdate --version >/dev/null 2>&1 ; then
-                   DATE_COMMAND=gdate
+                   date() {
+                     gdate "$@"
+                   }
 		   echo Using gdate.
 		   echo Using gdate.
 		else
 		else
 		   echo ERROR: Not GNU date found.
 		   echo ERROR: Not GNU date found.
@@ -676,14 +678,9 @@ date_version_detect() {
 		   echo Exiting...
 		   echo Exiting...
 		   exit
 		   exit
 		fi
 		fi
-
-	else
-		DATE_COMMAND=date
 	fi    
 	fi    
 }
 }
-date() {
-$DATE_COMMAND "$@"
-} 
+
 # Main function
 # Main function
 # Encapsulated on its own function for readability purposes
 # Encapsulated on its own function for readability purposes
 #
 #