source: trunk/src/plogd.sh @ 2

Last change on this file since 2 was 2, checked in by pinsard, 15 years ago

first commit with original work of Francoise Pinsard

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/sh
2#
3#+
4#
5# NAME
6# ====
7#
8# plogd.sh - prints the most recent release of ${IRCAAM_LOG}/action.log.AAAA-MM-JJTHH:MM:SSZ
9#
10# SYNOPSIS
11# ========
12#
13# ::
14#
15#  $ plogd.sh action
16#
17#
18# DESCRIPTION
19# ===========
20#
21# ``plogd.sh`` prints the most recent release of ${IRCAAM_LOG}/action.log.YYYY-MM-DDTHH:MM:SSZ.
22#
23#
24# It uses a2ps application.
25#
26# Print is one on the default printer.
27#
28# SEE ALSO
29# ========
30#
31# ircaam_profile.sh_
32#
33# .. _ircaam_profile.sh : ircaam_profile.sh.html
34#
35# dlogd.sh_
36#
37# .. _dlogd.sh : dlogd.sh.html
38#
39# elogd.sh_
40#
41# .. _elogd.sh : elogd.sh.html
42#
43# tlogd.sh_
44#
45# .. _tlogd.sh : tlogd.sh.html
46#
47# FILES
48# =====
49#
50# original location
51# ~~~~~~~~~~~~~~~~~
52#
53# /usr/home/fplod/incas/ircaam/ircaam_ws/src/plogd.sh sur cerbere.locean-ipsl.upmc.fr
54#
55# EVOLUTIONS
56# ==========
57#
58# $Id$
59#
60# - fplod 2006-02-20T16:15:35Z aedon.lodyc.jussieu.fr (Darwin)
61#
62#   * posix
63#
64#-
65#
66set -u
67system=$(uname)
68case "${system}" in
69AIX|IRIX64)
70  echo " www : no specific posix checking"
71;;
72*)
73  set -o posix
74;;
75esac
76#
77command=$(basename ${0})
78#
79if [ "${1}" = "" ]
80then
81 echo "${command} : eee : 1st parameter missing" >&2
82 exit 1
83fi
84# test if a2ps available
85tool=a2ps
86type ${tool} 1> /dev/null 2>&1
87status=${?}
88if [ ${status} -ne 0 ]
89then
90 echo "${command} : eee : ${tool} unavailable" >&2
91 exit 4
92fi
93unset tool
94unset status
95#
96systeme=`uname`
97#
98log=$(find ${IRCAAM_LOG} -name "${1}.log.????-??-??T??:??:??Z" | sort | \
99tail -n 1)
100tmp=${?}
101if [ ${tmp} -eq 0 ]
102then
103 if [ "${log}" = "" ]
104 then
105  echo "${command} : eee : no release of ${IRCAAM_LOG}/${1}.log" >&2
106  exit 1
107 else
108  # printing
109  a2ps --print-anyway=1 ${log}
110  exit 0
111 fi
112else
113 exit 1
114fi
Note: See TracBrowser for help on using the repository browser.