]>
Commit | Line | Data |
---|---|---|
db652f61 TK |
1 | #!/bin/bash |
2 | ||
3 | # | |
4 | # Copyright (C) 2007 Karel Zak <kzak@redhat.com> | |
5 | # | |
6 | # This file is part of util-linux. | |
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 | # | |
e130ce53 | 18 | TS_TOPDIR="${0%/*}/../.." |
db652f61 TK |
19 | TS_DESC="year with week numbers" |
20 | ||
21 | . $TS_TOPDIR/functions.sh | |
22 | ts_init "$*" | |
23 | ||
2f791546 SK |
24 | ts_check_test_command "$TS_CMD_CAL" |
25 | ||
e0e9ff9e | 26 | export TERM=linux |
db652f61 TK |
27 | |
28 | USETERM=$( ts_has_option "useterm" "$*" ) | |
29 | MYTIME="29 11 2006" | |
30 | ||
31 | [ "$USETERM" == "yes" ] && TS_VERBOSE="yes" | |
32 | ts_log "" | |
33 | ||
34 | ts_log "Gregorian - Monday-based week with week numbers" | |
35 | if [ "$USETERM" == "yes" ]; then | |
36 | $TS_CMD_CAL -ymw $MYTIME | |
37 | fi | |
38 | $TS_CMD_CAL -ymw $MYTIME >> $TS_OUTPUT | |
39 | ||
40 | ts_log "Gregorian - Sunday-based week with week numbers" | |
41 | if [ "$USETERM" == "yes" ]; then | |
42 | $TS_CMD_CAL -ysw $MYTIME | |
43 | fi | |
44 | $TS_CMD_CAL -ysw $MYTIME >> $TS_OUTPUT | |
45 | ||
46 | ||
47 | ts_log "Julian - Monday-based week with week numbers" | |
48 | if [ "$USETERM" == "yes" ]; then | |
49 | $TS_CMD_CAL -ymjw $MYTIME | |
50 | fi | |
51 | $TS_CMD_CAL -ymjw $MYTIME >> $TS_OUTPUT | |
52 | ||
53 | ts_log "Julian - Sunday-based week with week numbers" | |
54 | if [ "$USETERM" == "yes" ]; then | |
55 | $TS_CMD_CAL -ysjw $MYTIME | |
56 | fi | |
57 | $TS_CMD_CAL -ysjw $MYTIME >> $TS_OUTPUT | |
58 | ||
59 | ts_finalize | |
60 |