diff options
author | emaste <emaste@FreeBSD.org> | 2010-10-19 15:18:40 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2010-10-19 15:18:40 +0000 |
commit | 9a17b8dd07f76fb44a30fbfdcec1f125330d278f (patch) | |
tree | 5763e88de719dd1b888a5051fae858b9b239c93c | |
parent | adec94f194ad8834756dc601133ddd1db65ef68a (diff) | |
download | FreeBSD-src-9a17b8dd07f76fb44a30fbfdcec1f125330d278f.zip FreeBSD-src-9a17b8dd07f76fb44a30fbfdcec1f125330d278f.tar.gz |
Simplify and significantly speed up the timezone listing backend script.
Reviewed by: imp
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend-query/list-tzones.sh | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh b/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh index 640272e..c7009b0 100755 --- a/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh +++ b/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh @@ -25,19 +25,10 @@ # # $FreeBSD$ -rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null - # Backend script which lists all the available timezones for front-ends to display -while read line -do - echo "$line" | grep "^#" >/dev/null 2>/dev/null - if [ "$?" != "0" ] - then - echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp - fi -done < /usr/share/zoneinfo/zone.tab - -sort ${TMPDIR}/.tzonetmp -rm -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null +egrep -v '^#' /usr/share/zoneinfo/zone.tab |\ + tr -s "\t" ":" |\ + cut -d ":" -f 3-4 |\ + sort exit 0 |