Igor Sarkisov | c9d10aa | 2020-10-06 15:22:51 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # |
| 4 | # Copyright (C) 2007 Karel Zak <kzak@redhat.com> |
| 5 | # |
| 6 | # This file is part of util-linux-ng. |
| 7 | # |
| 8 | # This file is free software; you can redistribute it and/or modify |
| 9 | # it under the terms of the GNU General Public License as published by |
| 10 | # the Free Software Foundation; either version 2 of the License, or |
| 11 | # (at your option) any later version. |
| 12 | # |
| 13 | # This file is distributed in the hope that it will be useful, |
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | # GNU General Public License for more details. |
| 17 | # |
| 18 | |
| 19 | TS_TOPDIR="$(dirname $0)/../.." |
| 20 | TS_DESC="1 month" |
| 21 | |
| 22 | . $TS_TOPDIR/functions.sh |
| 23 | ts_init "$*" |
| 24 | |
| 25 | set -o pipefail |
| 26 | |
| 27 | USETERM=$( ts_has_option "useterm" "$*" ) |
| 28 | MYTIME="27 09 2006" |
| 29 | |
| 30 | [ "$USETERM" == "yes" ] && TS_VERBOSE="yes" |
| 31 | ts_log "" |
| 32 | |
| 33 | ts_log "Gregorian - Monday-based week" |
| 34 | if [ "$USETERM" == "yes" ]; then |
| 35 | $TS_CMD_CAL -1m $MYTIME |
| 36 | fi |
| 37 | $TS_CMD_CAL -1m $MYTIME >> $TS_OUTPUT |
| 38 | |
| 39 | ts_log "Gregorian - Sunday-based week" |
| 40 | if [ "$USETERM" == "yes" ]; then |
| 41 | $TS_CMD_CAL -1s $MYTIME |
| 42 | fi |
| 43 | $TS_CMD_CAL -1s $MYTIME >> $TS_OUTPUT |
| 44 | |
| 45 | |
| 46 | ts_log "Julian - Monday-based week" |
| 47 | if [ "$USETERM" == "yes" ]; then |
| 48 | $TS_CMD_CAL -1mj $MYTIME |
| 49 | fi |
| 50 | $TS_CMD_CAL -1mj $MYTIME >> $TS_OUTPUT |
| 51 | |
| 52 | ts_log "Julian - Sunday-based week" |
| 53 | if [ "$USETERM" == "yes" ]; then |
| 54 | $TS_CMD_CAL -1sj $MYTIME |
| 55 | fi |
| 56 | $TS_CMD_CAL -1sj $MYTIME >> $TS_OUTPUT |
| 57 | |
| 58 | ts_finalize |
| 59 | |