source: trunk/src/plogd.sh @ 85

Last change on this file since 85 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#
47set -u
48system=$(uname)
49case "${system}" in
50   AIX|IRIX64)
51      echo " www : no specific posix checking"
52   ;;
53   *)
54      set -o posix
55;;
56esac
57unset system
58#
59LANG=POSIX
60#
61command=$(basename ${0})
62#
63if [ "${1}" = "" ]
64then
65   echo "${command} : eee : 1st parameter missing" >&2
66   exit 1
67fi
68# test if a2ps available
69tool=a2ps
70type ${tool} 1> /dev/null 2>&1
71status=${?}
72if [ ${status} -ne 0 ]
73then
74   echo "${command} : eee : ${tool} unavailable" >&2
75   exit 4
76fi
77unset tool
78unset status
79#
80log=$(find ${PROJECT_LOG} -name "${1}.log.????????T??????Z" | sort | \
81tail -n 1)
82tmp=${?}
83if [ ${tmp} -eq 0 ]
84then
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
94else
95   exit 1
96fi
Note: See TracBrowser for help on using the repository browser.