File: xxdate.exe

package info (click to toggle)
hevea 1.07-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,624 kB
  • ctags: 2,053
  • sloc: ml: 17,062; sh: 344; makefile: 183
file content (17 lines) | stat: -rwxr-xr-x 726 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/sh
cat <<EOF
%% TeX counters
\newcounter{year}\setcounter{year}{`date +"%Y" 2> /dev/null || date | awk '{print $NF}'`}
\newcounter{month}\setcounter{month}{`date +"%m"`}
\newcounter{day}\setcounter{day}{`date +"%d"`}
\newcounter{time}\setcounter{time}{60 * `date +"%H"` + `date +"%M"`}
%% Extras
\newcounter{hour}\setcounter{hour}{`date +"%H"`}
\newcounter{Hour}\setcounter{Hour}{\value{hour}-(\value{hour}/12)*12}
\newcounter{weekday}\setcounter{weekday}{`date +"%w"`}
\newcounter{minute}\setcounter{minute}{`date +"%M"`}
\newcounter{second}\setcounter{second}{`date +"%S"`}
\def\ampm{\ifthenelse{\value{hour}>12}{PM}{AM}}
\def\timezone{`date +"%Z" 2> /dev/null || date | awk '{print $5}'`}
\def\heveadate{`date`}
EOF