From dadccb496713a424bf80828b8a538b06d8dea9ae Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 12 Jun 2020 18:38:12 -0400 Subject: [PATCH] timezone: fix date alias when using it with args --- .profile.d/timezone.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.profile.d/timezone.sh b/.profile.d/timezone.sh index eeda999..2a00e86 100644 --- a/.profile.d/timezone.sh +++ b/.profile.d/timezone.sh @@ -4,4 +4,9 @@ if [[ $- == *i* && -n ${TZ} ]] ; then 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 "$@" +} -- 2.39.2