]> git.wh0rd.org - home.git/commitdiff
timezone: fix date alias when using it with args
authorMike Frysinger <vapier@gentoo.org>
Fri, 12 Jun 2020 22:38:12 +0000 (18:38 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 12 Jun 2020 22:38:12 +0000 (18:38 -0400)
.profile.d/timezone.sh

index eeda99972feb788cc874c38268e576e715710024..2a00e86e37eb022eba646d823ffc4786dd69984f 100644 (file)
@@ -4,4 +4,9 @@ if [[ $- == *i* && -n ${TZ} ]] ; then
        echo "Timezone now set to $TZ"
 fi
 
        echo "Timezone now set to $TZ"
 fi
 
-alias date='date "+%a %d %b %Y %T %Z %z"'
+date() {
+       if [[ $# -eq 0 ]] ; then
+               set -- "+%a %d %b %Y %T %Z %z"
+       fi
+       command date "$@"
+}