📄 tz_dst
字号:
#!/bin/sh5########################################################################## Copyright (c) 1988, 1989 by# Digital Equipment Corporation, Maynard, MA# All rights reserved.## This software is furnished under a license and may be used and# copied only in accordance with the terms of such license and# with the inclusion of the above copyright notice. This# software or any other copies thereof may not be provided or# otherwise made available to any other person. No title to and# ownership of the software is hereby transferred. ## The information in this software is subject to change without# notice and should not be construed as a commitment by Digital# Equipment Corporation. ## Digital assumes no responsibility for the use or reliability# of its software on equipment which is not supplied by Digital.## SCCSID = "@(#)tz_dst 4.1 (ULTRIX) 7/27/90"## 000 Jonathan Wallace 1-Jun-1990###########################################################################trap 'exit' 1 2 3 18LL=""clearwhile : truedo echo "*** TIME ZONE SELECTION *** Select the time zone for your area, using the options listed in thetable below. You can also enter the number of hours (-12 to 12) intime east of Greenwich. Selection Time Zone --------------------------------- e Eastern c Central m Mountain p Pacific g Greenwich---------------------------------Enter your choice [no default]: \c" read zone case ${zone} in e|E) hourswest=5 ZIC="/etc/zoneinfo/US/Eastern" ;; c|C) hourswest=6 ZIC="/etc/zoneinfo/US/Central" ;; m|M) hourswest=7 ZIC="/etc/zoneinfo/US/Mountain" ;; p|P) hourswest=8 ZIC="/etc/zoneinfo/US/Pacific" ;; g|G) hourswest=0 ZIC="/etc/zoneinfo/GMT" ;; [0-9] | 1[0-2] ) hourswest="-${zone}" ZIC="GMT${zone}" ;; -[1-9] | -1[0-2] ) hourswest=`expr $zone : '[-]\(.*\)'` ZIC="GMT${zone}" ;; "") clear echo "" continue ;; *) clear echo "Sorry, {$zone}, is not a valid timezone option. Please enterone of the menu options listed below." continue ;; esac breakdonewhile : truedo clear echo "Does your area alternate between Daylight Savings and Standardtime? (y/n) [y]: \c" read dst case ${dst} in [yY]*|"") while true do echo "Select your geographic area for Daylight Savings Time, using theoptions in the table below. Selection Geographic Area -------------------------------- u USA a Australia e Eastern Europe c Central Europe w Western Europe--------------------------------Enter your choice [no default]: \c" read dst case ${dst} in u|U) dst=1; geog=u ;; a|A) dst=2 ; geog=a;; w|W) dst=3; geog=w ;; c|C) dst=4; geog=c ;; e|E) dst=5; geog=e ;; *) clear echo "Sorry, '${dst}' is not a valid option. Please select a choicefrom the menu below." continue ;; esac break done ;; [nN]*) dst=n; geog=n ;; *) echo "" continue ;; esac breakdonecase ${dst} in"" | n) TIMEZONE=$hourswest ;;*) TIMEZONE="$hourswest dst ${dst}" ;;esac## Because the timezone in the kernel is in the east of USA,# time needs to be adjusted.# tt=`expr $hourswest : '-\(.*\)' '|' $hourswest`tttt=`expr $tt '*' 60`case $hourswest in0 ) tttt=0000 ;;1 ) tttt=00${tttt} ;;-1 ) tttt=-00${tttt} ;;-* ) tttt=-0${tttt} ;;* ) tttt=0${tttt} ;;esac# In case timezone and dst do not match tnc=`date +%y\%m\%d\%H\%M.%S`date $tnc-$tttt$geog >/dev/null 2>&1 /etc/zic -d /etc/zoneinfo -l $ZICecho "${LL}The current date and time is `date`"echo "$TIMEZONE" > /tmp/timezonesleep 3exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -