Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| #!/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 |