Get the date of the days before today on AIX
2015-09-10 00:00
381 查看
The date command in AIX doesn't support "-d" switch.
So it is not easy to get the date of the days before (or after) today.
After research, I think it is best to use perl to compute the date we want.
Here it is:
So it is not easy to get the date of the days before (or after) today.
After research, I think it is best to use perl to compute the date we want.
Here it is:
#!/usr/bin/env sh DAYS=-5 DATE=`DAYS=$DAYS perl -MPOSIX -le 'print strftime("%Y%m%d", localtime(time() + $ENV{'DAYS'} *24 *60 *60))'` #echo $DATE
相关文章推荐
- AIX mount: 0506-351 错误处理
- 0403-027 The parameter list is too long
- Perl模块编写说明
- perl如何避免脚本在windows中闪一下就关闭
- Perl中的特殊内置变量详细介绍
- dos 日期时间格式设置使用小结(Date和Time)
- linux下使用perl获取本机ip的几种方法介绍
- perl 控制结构 条件控制 if while
- Perl中的列表和数组学习笔记
- perl数据库添加、删除、更新、查询操作例子
- perl操作MongoDB报错undefined symbol: HeUTF8解决方法
- Perl中使用MIME::Lite发送邮件实例
- 什么是Perl?编程语言Perl详细介绍
- About Perl(翻译Perl官网介绍)
- perl 基本语法介绍
- perl 模式匹配参数详解
- PERL脚本 学习笔记
- perl 列表和数组变量详解
- 探索Perl的世界(更新到40集)-Perl视频教程
- perl 文件读写详细说明