HP and AIX上的date问题
来源:互联网 发布:淘宝直播一般佣金多少 编辑:程序博客网 时间:2024/05/16 07:24
一、
aaa=`echo $TZ|sed 's/.*/(../)//1/'`
aaa=`expr $aaa + 24`
eval aaa=`echo $TZ|sed 's/..$/+$aaa/'`
TZ=$aaa
export TZ
yy=`date +%y`
mm=`date +%m`
dd=`date +%d`
echo $mm$dd$yy
二、
# step 1, generate application statistics at the morning for yesterday
get_one_day_before_specified_date()
{
#get the command line input(date month & year)
day=$1
month=$2
year=$3
# if it is the first day of the month
if [ $day -eq 01 ]
then
# if it is the first month of the year
if [ $month -eq 01 ]
then
# make the month as 12
month=12
# deduct the year by one
year=`expr $year - 1`
else
# deduct the month by one
month=`expr $month - 1`
fi
# use cal command, discard blank lines,
# take last field of last line,
# first awk command is used to get the
# last useful line of the calendar cmd,
# second awk command is used to get the
# last field of this last useful line,
# NF is no. of fields,
# $NF is value of last field
day=`cal $month $year | awk 'NF != 0{ last = $0 }; END{ print last }' | awk '{ print $NF }'`
else
# deduct the day by one
day=`expr $day - 1`
fi
# echo $month $day $year
year_2dig=`echo $year|awk '{print substr($0,3)}'`
echo $month/$day/$year_2dig
}
YEAR_T=`date +%Y`;
MONTH_T=`date +%m`;
DAY_T=`date +%d`;
YESTERDAY=`get_one_day_before_specified_date $DAY_T $MONTH_T $YEAR_T`;
- HP and AIX上的date问题
- LVM操作在HP-UX和AIX上的区别
- aix上的null问题
- aix上apache启动的诡异问题
- 关于AIX主机上^M的问题
- AIX上的date命令和循环语句与linux上的不同
- IBM-AIX、SunOS、Linux、HP-UX上获取心跳时间
- AIX/HP UX/LINUX 上ORACLE ASM 添加磁盘
- HP Xeon 55xx上GPU的带宽问题
- HP 上编译的32位64位问题
- Weblogic Aix系统上乱码问题的解决
- Weblogic9.2在aix上安装需注意的问题
- 关于AIX上的编译器
- AIX上的char类型
- erlang aix 上的安装
- erlang aix 上的安装
- AIX 上的配置 Samba
- AIX上iptrace的使用
- TBB记录2
- php-mysql-create-file
- SIP 成员参加会议过程-8
- ASP.NET 中的默认焦点和响应回车键的问题
- KMP
- HP and AIX上的date问题
- 归并排序
- Delphi多维动态数组重定义长度
- 汉诺塔问题具体解答递归方法
- 互动网计算机频道图书7日销售排行(07.09-07.15)
- 判断JavaScript的类型
- 快速排序
- 动态规划法压缩矩阵
- 数组的简单应用