Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (21 sloc) 351 Bytes
#!/bin/bash
name=$(basename "$0")
if [ -z "$1" ]
then
args="UTC US/Eastern US/Pacific Asia/Shanghai Europe/London"
echo "Usage: $name timezone"
echo
else
args="$@"
fi
for i in $args
do
if [ -f "/usr/share/zoneinfo/$i" ]
then
printf "%-16s %s\n" "${i}:" "$(TZ="$i" date)"
else
echo Error: Timezone $i not exist.
exit 1
fi
done
exit 0