/usr/bin
NameSizeModeActions
aclocal364780755editdlrm
aclocal-1.16364780755editdlrm
addr2line342240755editdlrm
agentxtrap251280755editdlrm
animate121280755editdlrm
ar634480755editdlrm
arch382320755editdlrm
arpaname121040755editdlrm
as9112640755editdlrm
aspell1633280755editdlrm
at12760755editdlrm
atq12780755editdlrm
atrm12800755editdlrm
autoconf147680755editdlrm
autoheader85340755editdlrm
autom4te321810755editdlrm
automake2579490755editdlrm
automake-1.162579490755editdlrm
autoreconf210660755editdlrm
autoscan171240755editdlrm
autoupdate338720755editdlrm
awk6858480755editdlrm
b2sum590720755editdlrm
base32424640755editdlrm
base64424880755editdlrm
basename383120755editdlrm
bash11546800755editdlrm
bashbug-6473480755editdlrm
batch1370755editdlrm
bison4482240755editdlrm
bunzip2377440755editdlrm
bzcat377440755editdlrm
bzcmp21280755editdlrm
bzdiff21280755editdlrm
bzgrep16770755editdlrm
bzip2377440755editdlrm
bzip2recover168320755editdlrm
bzless12590755editdlrm
bzmore12590755editdlrm
c++12666160755editdlrm
c++filt295840755editdlrm
c892240755editdlrm
c992150755editdlrm
cagefs_enter.proxied12960755editdlrm
cal675600755editdlrm
captoinfo873600755editdlrm
cat383600755editdlrm
catchsegv32830755editdlrm
cc12665760755editdlrm
chcon720240755editdlrm
chgrp678640755editdlrm
chmod636880755editdlrm
chown719760755editdlrm
chrt380800755editdlrm
cksum382880755editdlrm
cldetect105930755editdlrm
clear128400755editdlrm
cmp1062480755editdlrm
col297040755editdlrm
colcrt168720755editdlrm
colrm254800755editdlrm
column506560755editdlrm
comm425600755editdlrm
compare121360755editdlrm
composite121200755editdlrm
conjure121200755editdlrm
convert121200755editdlrm
cp1515680755editdlrm
cpan83700755editdlrm
cpp12665520755editdlrm
crontab15240755editdlrm
crontab.cagefs554560755editdlrm
csplit549680755editdlrm
curl2356000755editdlrm
cut507040755editdlrm
date1084960755editdlrm
dbiprof62060755editdlrm
dd798400755editdlrm
delv434800755editdlrm
df932720755editdlrm
diff2744400755editdlrm
diff31316880755editdlrm
dig1660720755editdlrm
dir1432560755editdlrm
dircolors507440755editdlrm
dirname341600755editdlrm
display121280755editdlrm
dnstap-read209200755editdlrm
du1095680755editdlrm
easy_install-3-0editdlrm
echo382480755editdlrm
egrep280755editdlrm
enc2xs419580755editdlrm
enchant215840755editdlrm
enchant-lsmod134080755editdlrm
env423440755editdlrm
eps2eps6390755editdlrm
eqn2377280755editdlrm
ex11803520755editdlrm
expand425920755editdlrm
expr507600755editdlrm
factor880320755editdlrm
false341200755editdlrm
fc-cache1320755editdlrm
fc-cache-64208400755editdlrm
fc-cat167440755editdlrm
fc-conflist125440755editdlrm
fc-list125440755editdlrm
fc-match166480755editdlrm
fc-pattern125520755editdlrm
fc-query125360755editdlrm
fc-scan125520755editdlrm
fc-validate166480755editdlrm
fgrep280755editdlrm
file252800755editdlrm
find2286320755editdlrm
flex4387280755editdlrm
flex++4387280755editdlrm
flock339920755editdlrm
fmt465840755editdlrm
fold424080755editdlrm
free212880755editdlrm
freetype-config44160755editdlrm
funzip375040755editdlrm
g++12666160755editdlrm
gawk6858480755editdlrm
gcc12665760755editdlrm
gcc-ar375360755editdlrm
gcc-nm375360755editdlrm
gcc-ranlib375360755editdlrm
gcov13774080755editdlrm
gcov-dump5846640755editdlrm
gcov-tool6223600755editdlrm
gencat254320755editdlrm
geoiplookup224160755editdlrm
geoiplookup6221680755editdlrm
geqn2377280755editdlrm
GET162170755editdlrm
getconf332400755editdlrm
getent339200755editdlrm
getopt210240755editdlrm
ghostscript126480755editdlrm
git38459280755editdlrm
git-receive-pack38459280755editdlrm
git-shell22366880755editdlrm
git-upload-archive38459280755editdlrm
git-upload-pack38459280755editdlrm
gm80240755editdlrm
gmake2409680755editdlrm
gneqn9080755editdlrm
gnroff33120755editdlrm
gpg10903440755editdlrm
gpg-agent4293600755editdlrm
gpg-error349760755editdlrm
gpg-zip35250755editdlrm
gpgsplit891120755editdlrm
gpgv4623440755editdlrm
gpic3008960755editdlrm
gprof1058320755editdlrm
grep1982800755editdlrm
groff1279200755editdlrm
grops1957280755editdlrm
grotty1453040755editdlrm
groups382880755editdlrm
gs126480755editdlrm
gsnd2770755editdlrm
gsoelim435760755editdlrm
gtar4597680755editdlrm
gtbl1583200755editdlrm
gtroff8243440755editdlrm
gunzip23450755editdlrm
gzexe63750755editdlrm
gzip969440755editdlrm
h2ph293820755editdlrm
h2xs608660755editdlrm
head465920755editdlrm
hexdump588880755editdlrm
host1457040755editdlrm
hostid341360755editdlrm
hostname216640755editdlrm
hunspell1481680755editdlrm
iconv629040755editdlrm
id465280755editdlrm
identify121280755editdlrm
idn403520755editdlrm
ifnames41280755editdlrm
import121200755editdlrm
infocmp625120755editdlrm
infotocap873600755editdlrm
install1599120755editdlrm
instmodsh41940755editdlrm
ionice296800755editdlrm
ipcrm296880755editdlrm
ipcs546800755editdlrm
isosize254800755editdlrm
ispell9880755editdlrm
join549840755editdlrm
kill381760755editdlrm
ld17890800755editdlrm
ld.bfd17890800755editdlrm
ldd54410755editdlrm
less1779280755editdlrm
lessecho126960755editdlrm
lesskey225200755editdlrm
lesspipe.sh31430755editdlrm
lex4387280755editdlrm
libnetcfg157750755editdlrm
libtool3677240755editdlrm
libtoolize1291970755editdlrm
link341360755editdlrm
ln721920755editdlrm
locale578000755editdlrm
localedef3148480755editdlrm
logger511840755editdlrm
login419440755editdlrm
logname341440755editdlrm
look168560755editdlrm
ls1432480755editdlrm
m41900160755editdlrm
Magick-config14600755editdlrm
MagickCore-config15960755editdlrm
MagickWand-config15970755editdlrm
Mail4187040755editdlrm
mail4187040755editdlrm
mailx4187040755editdlrm
make2409680755editdlrm
make-dummy-cert6100755editdlrm
mariadb55863280755editdlrm
mariadb-access1119610755editdlrm
mariadb-admin51114880755editdlrm
mariadb-binlog54131120755editdlrm
mariadb-check51045440755editdlrm
mariadb-conv48005440755editdlrm
mariadb-convert-table-format42210755editdlrm
mariadb-dump52009360755editdlrm
mariadb-dumpslow82420755editdlrm
mariadb-embedded254350720755editdlrm
mariadb-find-rows32900755editdlrm
mariadb-hotcopy353590755editdlrm
mariadb-import50952000755editdlrm
mariadb-plugin47794080755editdlrm
mariadb-secure-installation137990755editdlrm
mariadb-setpermission179770755editdlrm
mariadb-show50936800755editdlrm
mariadb-slap51131680755editdlrm
mariadb-tzinfo-to-sql47787920755editdlrm
mariadb-waitpid47662000755editdlrm
mc13603200755editdlrm
mcdiff13603200755editdlrm
mcedit13603200755editdlrm
mcookie340640755editdlrm
mcview13603200755editdlrm
md5sum466320755editdlrm
mesg167520755editdlrm
mkdir846800755editdlrm
mkfifo680560755editdlrm
mknod721600755editdlrm
mktemp467600755editdlrm
mogrify121200755editdlrm
montage121200755editdlrm
more460160755editdlrm
msql2mysql14460755editdlrm
mv1474080755editdlrm
mysql55863280755editdlrm
mysqlaccess1119610755editdlrm
mysqladmin51114880755editdlrm
mysqlbinlog54131120755editdlrm
mysqlcheck51045440755editdlrm
mysqldump52009360755editdlrm
mysqlimport50952000755editdlrm
mysqlshow50936800755editdlrm
mysql_config46230755editdlrm
mysql_find_rows32900755editdlrm
mysql_waitpid47662000755editdlrm
mytop737570755editdlrm
my_print_defaults47706720755editdlrm
namei338960755editdlrm
nano2538880755editdlrm
neqn9080755editdlrm
net-snmp-create-v3-user32230755editdlrm
nice382240755editdlrm
nl466480755editdlrm
nm515840755editdlrm
nohup383120755editdlrm
nproc383040755editdlrm
nroff33120755editdlrm
nslookup1497680755editdlrm
nsupdate748080755editdlrm
numfmt672160755editdlrm
objcopy2458320755editdlrm
objdump4298320755editdlrm
od755760755editdlrm
openssl7638560755editdlrm
pango-list121600755editdlrm
pango-view588160755editdlrm
passwd12840755editdlrm
paste382800755editdlrm
patch2114160755editdlrm
pathchk382240755editdlrm
pdf2dsc6980755editdlrm
pdf2ps9090755editdlrm
perl127280755editdlrm
perl5.26.3127280755editdlrm
perlbug454580755editdlrm
perldoc1180755editdlrm
perlivp108130755editdlrm
perlml67680755editdlrm
perlthanks454580755editdlrm
pgrep295360755editdlrm
php9370755editdlrm
pic3008960755editdlrm
piconv82710755editdlrm
pinentry24040755editdlrm
pinentry-curses797600755editdlrm
ping677120755editdlrm
pinky424560755editdlrm
pip-3-0editdlrm
pip3-0editdlrm
pkg-config410000755editdlrm
pkgconf410000755editdlrm
pkill295360755editdlrm
pl2pm45330755editdlrm
pmap335680755editdlrm
pod2html41340755editdlrm
pod2man150340755editdlrm
pod2text108030755editdlrm
pod2usage39480755editdlrm
podchecker36580755editdlrm
podselect25270755editdlrm
post-grohtml2444560755editdlrm
pr841200755editdlrm
pre-grohtml1336880755editdlrm
precat56560755editdlrm
preunzip56560755editdlrm
prezip56560755editdlrm
prezip-bin122640755editdlrm
printenv341200755editdlrm
printf548480755editdlrm
prove135620755editdlrm
ps1379840755editdlrm
ps2ascii6310755editdlrm
ps2epsi27520755editdlrm
ps2pdf2720755editdlrm
ps2pdf122150755editdlrm
ps2pdf132150755editdlrm
ps2pdf142150755editdlrm
ps2pdfwr10970755editdlrm
ps2ps6470755editdlrm
ps2ps26690755editdlrm
ptx798640755editdlrm
pwd383200755editdlrm
pwdx129840755editdlrm
pydoc-3-0editdlrm
pydoc3-0editdlrm
python280320755editdlrm
python2.780320755editdlrm
python3118720755editdlrm
python3.6118720755editdlrm
python3.6m118720755editdlrm
pyvenv-3-0editdlrm
ranlib634560755editdlrm
raw168960755editdlrm
readelf6395280755editdlrm
readlink469840755editdlrm
realpath511440755editdlrm
recode481600755editdlrm
rename168960755editdlrm
renew-dummy-cert7250755editdlrm
renice168560755editdlrm
replace47486560755editdlrm
reset253520755editdlrm
rev127600755editdlrm
rm720640755editdlrm
rmdir465520755editdlrm
rnano2538880755editdlrm
run-with-aspell850755editdlrm
runcon382640755editdlrm
rvi11803520755editdlrm
rview11803520755editdlrm
rvim30677440755editdlrm
scalar22909120755editdlrm
scl377520755editdlrm
scl_enabled2580755editdlrm
scl_source18630755editdlrm
scp1053040755editdlrm
script376800755editdlrm
sdiff1078560755editdlrm
sed1182480755editdlrm
selectorctl78120755editdlrm
seq547280755editdlrm
setsid167680755editdlrm
setterm462080755editdlrm
sftp1635760755editdlrm
sh11546800755editdlrm
sha1sum466400755editdlrm
sha224sum466720755editdlrm
sha256sum466800755editdlrm
sha384sum466880755editdlrm
sha512sum466800755editdlrm
shred633360755editdlrm
shuf594880755editdlrm
size340480755editdlrm
skill294880755editdlrm
slabtop213440755editdlrm
sleep382880755editdlrm
snice294880755editdlrm
snmpconf260510755editdlrm
soelim435760755editdlrm
sort1264320755editdlrm
spell1220755editdlrm
splain191500755editdlrm
split594400755editdlrm
sprof293600755editdlrm
sqlite313465120755editdlrm
ssh7756480755editdlrm
ssh-add3544160755editdlrm
ssh-agent3334000755editdlrm
ssh-copy-id106940755editdlrm
ssh-keygen4374240755editdlrm
ssh-keyscan4388000755editdlrm
stat882320755editdlrm
stdbuf506880755editdlrm
strace20298320755editdlrm
stream121120755editdlrm
strings383280755editdlrm
strip2458560755editdlrm
stty794720755editdlrm
sum466240755editdlrm
sync382560755editdlrm
tabs169520755editdlrm
tac424880755editdlrm
tail759120755editdlrm
tar4597680755editdlrm
taskset381520755editdlrm
tbl1583200755editdlrm
tclsh92560755editdlrm
tclsh8.692560755editdlrm
tee424720755editdlrm
test548480755editdlrm
tic873600755editdlrm
timeout428640755editdlrm
tload171600755editdlrm
tmpwatch363200755editdlrm
toe168480755editdlrm
top1246160755editdlrm
touch961920755editdlrm
tput253920755editdlrm
tr508160755editdlrm
troff8243440755editdlrm
true341280755editdlrm
truncate423520755editdlrm
tset253520755editdlrm
tsort424880755editdlrm
tty341120755editdlrm
tzselect153700755editdlrm
uapi12800755editdlrm
ul210800755editdlrm
uname382240755editdlrm
unexpand467040755editdlrm
uniq508320755editdlrm
unlink341440755editdlrm
unversioned-python-0editdlrm
unzip2067280755editdlrm
unzipsfx1039120755editdlrm
uptime128880755editdlrm
users382880755editdlrm
utmpdump293520755editdlrm
vdir1432560755editdlrm
vi11803520755editdlrm
view11803520755editdlrm
vim30677440755editdlrm
vimdiff30677440755editdlrm
vimtutor21210755editdlrm
vmstat376720755editdlrm
Wand-config14550755editdlrm
watch298880755editdlrm
wc508320755editdlrm
wget5339280755editdlrm
whereis299760755editdlrm
which300880755editdlrm
who548800755editdlrm
whoami341360755editdlrm
word-list-compress122800755editdlrm
x86_64-redhat-linux-c++12666160755editdlrm
x86_64-redhat-linux-g++12666160755editdlrm
x86_64-redhat-linux-gcc12665760755editdlrm
x86_64-redhat-linux-gcc-812665760755editdlrm
xargs758880755editdlrm
xmlcatalog208640755editdlrm
xmllint751280755editdlrm
xmlwf378480755editdlrm
xsltproc291520755editdlrm
xsubpp50800755editdlrm
xxd210320755editdlrm
yes341680755editdlrm
zcat19830755editdlrm
zcmp16770755editdlrm
zdiff58790755editdlrm
zegrep290755editdlrm
zfgrep290755editdlrm
zforce20800755editdlrm
zgrep75820755editdlrm
zip2344960755editdlrm
zipcloak1053760755editdlrm
zipgrep29530755editdlrm
zipinfo2067280755editdlrm
zipnote1001040755editdlrm
zipsplit1001040755editdlrm
zless22050755editdlrm
zmore18410755editdlrm
znew45520755editdlrm
zsoelim435760755editdlrm
[548640755editdlrm
Edit: /usr/bin/tzselect (15370B)
#!/usr/bin/bash PKGVERSION="(GNU libc) " TZVERSION="2.28" REPORT_BUGS_TO="" # Ask the user about the time zone, and output the resulting TZ value to stdout. # Interact with the user via stderr and stdin. # Contributed by Paul Eggert. This file is in the public domain. # Porting notes: # # This script requires a Posix-like shell and prefers the extension of a # 'select' statement. The 'select' statement was introduced in the # Korn shell and is available in Bash and other shell implementations. # If your host lacks both Bash and the Korn shell, you can get their # source from one of these locations: # # Bash # Korn Shell # Public Domain Korn Shell # # For portability to Solaris 9 /bin/sh this script avoids some POSIX # features and common extensions, such as $(...) (which works sometimes # but not others), $((...)), and $10. # # This script also uses several features of modern awk programs. # If your host lacks awk, or has an old awk that does not conform to Posix, # you can use either of the following free programs instead: # # Gawk (GNU awk) # mawk # Specify default values for environment variables if they are unset. : ${AWK=awk} : ${TZDIR=/usr/share/zoneinfo} # Output one argument as-is to standard output. # Safer than 'echo', which can mishandle '\' or leading '-'. say() { printf '%s\n' "$1" } # Check for awk Posix compliance. ($AWK -v x=y 'BEGIN { exit 123 }') /dev/null 2>&1 [ $? = 123 ] || { say >&2 "$0: Sorry, your '$AWK' program is not Posix compatible." exit 1 } coord= location_limit=10 zonetabtype=zone1970 usage="Usage: tzselect [--version] [--help] [-c COORD] [-n LIMIT] Select a time zone interactively. Options: -c COORD Instead of asking for continent and then country and then city, ask for selection from time zones whose largest cities are closest to the location with geographical coordinates COORD. COORD should use ISO 6709 notation, for example, '-c +4852+00220' for Paris (in degrees and minutes, North and East), or '-c -35-058' for Buenos Aires (in degrees, South and West). -n LIMIT Display at most LIMIT locations when -c is used (default $location_limit). --version Output version information. --help Output this help. Report bugs to $REPORT_BUGS_TO." # Ask the user to select from the function's arguments, # and assign the selected argument to the variable 'select_result'. # Exit on EOF or I/O error. Use the shell's 'select' builtin if available, # falling back on a less-nice but portable substitute otherwise. if case $BASH_VERSION in ?*) : ;; '') # '; exit' should be redundant, but Dash doesn't properly fail without it. (eval 'set --; select x; do break; done; exit') /dev/null esac then # Do this inside 'eval', as otherwise the shell might exit when parsing it # even though it is never executed. eval ' doselect() { select select_result do case $select_result in "") echo >&2 "Please enter a number in range." ;; ?*) break esac done || exit } # Work around a bug in bash 1.14.7 and earlier, where $PS3 is sent to stdout. case $BASH_VERSION in [01].*) case `echo 1 | (select x in x; do break; done) 2>/dev/null` in ?*) PS3= esac esac ' else doselect() { # Field width of the prompt numbers. select_width=`expr $# : '.*'` select_i= while : do case $select_i in '') select_i=0 for select_word do select_i=`expr $select_i + 1` printf >&2 "%${select_width}d) %s\\n" $select_i "$select_word" done ;; *[!0-9]*) echo >&2 'Please enter a number in range.' ;; *) if test 1 -le $select_i && test $select_i -le $#; then shift `expr $select_i - 1` select_result=$1 break fi echo >&2 'Please enter a number in range.' esac # Prompt and read input. printf >&2 %s "${PS3-#? }" read select_i || exit done } fi while getopts c:n:t:-: opt do case $opt$OPTARG in c*) coord=$OPTARG ;; n*) location_limit=$OPTARG ;; t*) # Undocumented option, used for developer testing. zonetabtype=$OPTARG ;; -help) exec echo "$usage" ;; -version) exec echo "tzselect $PKGVERSION$TZVERSION" ;; -*) say >&2 "$0: -$opt$OPTARG: unknown option; try '$0 --help'"; exit 1 ;; *) say >&2 "$0: try '$0 --help'"; exit 1 ;; esac done shift `expr $OPTIND - 1` case $# in 0) ;; *) say >&2 "$0: $1: unknown argument"; exit 1 ;; esac # Make sure the tables are readable. TZ_COUNTRY_TABLE=$TZDIR/iso3166.tab TZ_ZONE_TABLE=$TZDIR/$zonetabtype.tab for f in $TZ_COUNTRY_TABLE $TZ_ZONE_TABLE do <"$f" || { say >&2 "$0: time zone files are not set up correctly" exit 1 } done # If the current locale does not support UTF-8, convert data to current # locale's format if possible, as the shell aligns columns better that way. # Check the UTF-8 of U+12345 CUNEIFORM SIGN URU TIMES KI. ! $AWK 'BEGIN { u12345 = "\360\222\215\205"; exit length(u12345) != 1 }' && { tmp=`(mktemp -d) 2>/dev/null` || { tmp=${TMPDIR-/tmp}/tzselect.$$ && (umask 77 && mkdir -- "$tmp") };} && trap 'status=$?; rm -fr -- "$tmp"; exit $status' 0 HUP INT PIPE TERM && (iconv -f UTF-8 -t //TRANSLIT <"$TZ_COUNTRY_TABLE" >$tmp/iso3166.tab) \ 2>/dev/null && TZ_COUNTRY_TABLE=$tmp/iso3166.tab && iconv -f UTF-8 -t //TRANSLIT <"$TZ_ZONE_TABLE" >$tmp/$zonetabtype.tab && TZ_ZONE_TABLE=$tmp/$zonetabtype.tab newline=' ' IFS=$newline # Awk script to read a time zone table and output the same table, # with each column preceded by its distance from 'here'. output_distances=' BEGIN { FS = "\t" while (getline &2 'Please identify a location' \ 'so that time zone rules can be set correctly.' continent= country= region= case $coord in ?*) continent=coord;; '') # Ask the user for continent or ocean. echo >&2 'Please select a continent, ocean, "coord", or "TZ".' quoted_continents=` $AWK ' BEGIN { FS = "\t" } /^[^#]/ { entry = substr($3, 1, index($3, "/") - 1) if (entry == "America") entry = entry "s" if (entry ~ /^(Arctic|Atlantic|Indian|Pacific)$/) entry = entry " Ocean" printf "'\''%s'\''\n", entry } ' <"$TZ_ZONE_TABLE" | sort -u | tr '\n' ' ' echo '' ` eval ' doselect '"$quoted_continents"' \ "coord - I want to use geographical coordinates." \ "TZ - I want to specify the time zone using the Posix TZ format." continent=$select_result case $continent in Americas) continent=America;; *" "*) continent=`expr "$continent" : '\''\([^ ]*\)'\''` esac ' esac case $continent in TZ) # Ask the user for a Posix TZ string. Check that it conforms. while echo >&2 'Please enter the desired value' \ 'of the TZ environment variable.' echo >&2 'For example, GST-10 is a zone named GST' \ 'that is 10 hours ahead (east) of UTC.' read TZ $AWK -v TZ="$TZ" 'BEGIN { tzname = "(<[[:alnum:]+-]{3,}>|[[:alpha:]]{3,})" time = "(2[0-4]|[0-1]?[0-9])" \ "(:[0-5][0-9](:[0-5][0-9])?)?" offset = "[-+]?" time mdate = "M([1-9]|1[0-2])\\.[1-5]\\.[0-6]" jdate = "((J[1-9]|[0-9]|J?[1-9][0-9]" \ "|J?[1-2][0-9][0-9])|J?3[0-5][0-9]|J?36[0-5])" datetime = ",(" mdate "|" jdate ")(/" time ")?" tzpattern = "^(:.*|" tzname offset "(" tzname \ "(" offset ")?(" datetime datetime ")?)?)$" if (TZ ~ tzpattern) exit 1 exit 0 }' do say >&2 "'$TZ' is not a conforming Posix time zone string." done TZ_for_date=$TZ;; *) case $continent in coord) case $coord in '') echo >&2 'Please enter coordinates' \ 'in ISO 6709 notation.' echo >&2 'For example, +4042-07403 stands for' echo >&2 '40 degrees 42 minutes north,' \ '74 degrees 3 minutes west.' read coord;; esac distance_table=`$AWK \ -v coord="$coord" \ -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ "$output_distances" <"$TZ_ZONE_TABLE" | sort -n | sed "${location_limit}q" ` regions=`say "$distance_table" | $AWK ' BEGIN { FS = "\t" } { print $NF } '` echo >&2 'Please select one of the following' \ 'time zone regions,' echo >&2 'listed roughly in increasing order' \ "of distance from $coord". doselect $regions region=$select_result TZ=`say "$distance_table" | $AWK -v region="$region" ' BEGIN { FS="\t" } $NF == region { print $4 } '` ;; *) # Get list of names of countries in the continent or ocean. countries=`$AWK \ -v continent="$continent" \ -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ ' BEGIN { FS = "\t" } /^#/ { next } $3 ~ ("^" continent "/") { ncc = split($1, cc, /,/) for (i = 1; i <= ncc; i++) if (!cc_seen[cc[i]]++) cc_list[++ccs] = cc[i] } END { while (getline &2 'Please select a country' \ 'whose clocks agree with yours.' doselect $countries country=$select_result;; *) country=$countries esac # Get list of names of time zone rule regions in the country. regions=`$AWK \ -v country="$country" \ -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ ' BEGIN { FS = "\t" cc = country while (getline &2 'Please select one of the following' \ 'time zone regions.' doselect $regions region=$select_result;; *) region=$regions esac # Determine TZ from country and region. TZ=`$AWK \ -v country="$country" \ -v region="$region" \ -v TZ_COUNTRY_TABLE="$TZ_COUNTRY_TABLE" \ ' BEGIN { FS = "\t" cc = country while (getline &2 "$0: time zone files are not set up correctly" exit 1 } esac # Use the proposed TZ to output the current date relative to UTC. # Loop until they agree in seconds. # Give up after 8 unsuccessful tries. extra_info= for i in 1 2 3 4 5 6 7 8 do TZdate=`LANG=C TZ="$TZ_for_date" date` UTdate=`LANG=C TZ=UTC0 date` TZsec=`expr "$TZdate" : '.*:\([0-5][0-9]\)'` UTsec=`expr "$UTdate" : '.*:\([0-5][0-9]\)'` case $TZsec in $UTsec) extra_info=" Selected time is now: $TZdate. Universal Time is now: $UTdate." break esac done # Output TZ info and ask the user to confirm. echo >&2 "" echo >&2 "The following information has been given:" echo >&2 "" case $country%$region%$coord in ?*%?*%) say >&2 " $country$newline $region";; ?*%%) say >&2 " $country";; %?*%?*) say >&2 " coord $coord$newline $region";; %%?*) say >&2 " coord $coord";; *) say >&2 " TZ='$TZ'" esac say >&2 "" say >&2 "Therefore TZ='$TZ' will be used.$extra_info" say >&2 "Is the above information OK?" doselect Yes No ok=$select_result case $ok in Yes) break esac do coord= done case $SHELL in *csh) file=.login line="setenv TZ '$TZ'";; *) file=.profile line="TZ='$TZ'; export TZ" esac test -t 1 && say >&2 " You can make this change permanent for yourself by appending the line $line to the file '$file' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you can use the $0 command in shell scripts:" say "$TZ"