Last change
on this file since 97 was
50,
checked in by pinsard, 13 years ago
|
replace TROPFLUX by PROJECT
|
-
Property svn:executable set to
*
|
File size:
1.6 KB
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | #+ |
---|
3 | # |
---|
4 | # .. program:: plogd.sh |
---|
5 | # |
---|
6 | # .. _plogd.sh: |
---|
7 | # |
---|
8 | # ===================================================================================================== |
---|
9 | # plogd.sh -- prints the most recent release of :file:`${PROJECT_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}` |
---|
10 | # ===================================================================================================== |
---|
11 | # |
---|
12 | # SYNOPSIS |
---|
13 | # ======== |
---|
14 | # |
---|
15 | # :: |
---|
16 | # |
---|
17 | # $ plogd.sh action |
---|
18 | # |
---|
19 | # |
---|
20 | # DESCRIPTION |
---|
21 | # =========== |
---|
22 | # |
---|
23 | # ``plogd.sh`` prints the most recent release of :file:`${PROJECT_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}`. |
---|
24 | # |
---|
25 | # Print is done on the default printer. |
---|
26 | # |
---|
27 | # SEE ALSO |
---|
28 | # ======== |
---|
29 | # |
---|
30 | # :ref:`project_profile.sh` |
---|
31 | # |
---|
32 | # :ref:`dlogd.sh` |
---|
33 | # |
---|
34 | # :ref:`elogd.sh` |
---|
35 | # |
---|
36 | # :ref:`tlogd.sh` |
---|
37 | # |
---|
38 | # EVOLUTIONS |
---|
39 | # ========== |
---|
40 | # |
---|
41 | # - fplod 20101213T145950Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
42 | # |
---|
43 | # * creation |
---|
44 | # |
---|
45 | #- |
---|
46 | # |
---|
47 | set -u |
---|
48 | system=$(uname) |
---|
49 | case "${system}" in |
---|
50 | AIX|IRIX64) |
---|
51 | echo " www : no specific posix checking" |
---|
52 | ;; |
---|
53 | *) |
---|
54 | set -o posix |
---|
55 | ;; |
---|
56 | esac |
---|
57 | unset system |
---|
58 | # |
---|
59 | LANG=POSIX |
---|
60 | # |
---|
61 | command=$(basename ${0}) |
---|
62 | # |
---|
63 | if [ "${1}" = "" ] |
---|
64 | then |
---|
65 | echo "${command} : eee : 1st parameter missing" >&2 |
---|
66 | exit 1 |
---|
67 | fi |
---|
68 | # test if a2ps available |
---|
69 | tool=a2ps |
---|
70 | type ${tool} 1> /dev/null 2>&1 |
---|
71 | status=${?} |
---|
72 | if [ ${status} -ne 0 ] |
---|
73 | then |
---|
74 | echo "${command} : eee : ${tool} unavailable" >&2 |
---|
75 | exit 4 |
---|
76 | fi |
---|
77 | unset tool |
---|
78 | unset status |
---|
79 | # |
---|
80 | log=$(find ${PROJECT_LOG} -name "${1}.log.????????T??????Z" | sort | \ |
---|
81 | tail -n 1) |
---|
82 | tmp=${?} |
---|
83 | if [ ${tmp} -eq 0 ] |
---|
84 | then |
---|
85 | if [ "${log}" = "" ] |
---|
86 | then |
---|
87 | echo "${command} : eee : no release of ${PROJECT_LOG}/${1}.log" >&2 |
---|
88 | exit 1 |
---|
89 | else |
---|
90 | # printing |
---|
91 | a2ps --print-anyway=1 ${log} |
---|
92 | exit 0 |
---|
93 | fi |
---|
94 | else |
---|
95 | exit 1 |
---|
96 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.