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