ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 月末最后一天的判断shell脚本

月末最后一天的判断shell脚本

原创 Linux操作系统 作者:os-ora 时间:2010-08-03 16:25:23 0 删除 编辑
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE思想:判断月末最后1天,也须是28,29,30,31号;但是月末最后1天的下1天肯定是1号。
适用于:bsh,bash,ksh,Perl
操作系统:Unix平台 linux


#!/bin/bash
#file=
if [ `TZ=PST-24 date +%d` = '01' ];then
       echo "fuck the world"
fi
#$file


更为简单的linux平台下应用。


if [`date -d tomorrow +%d` = '01'];then
    echo "this is cool"
fi

 


if [`date -d "+1day" +%d` = '01'];then
    echo "day of the month"
fi

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16566331/viewspace-670112/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-01-12

  • 博文量
    148
  • 访问量
    410409