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
|
Rev | Line | |
---|
[2] | 1 | #! /bin/sh |
---|
| 2 | #+ |
---|
| 3 | # |
---|
[82] | 4 | # .. _plogd.sh: |
---|
| 5 | # |
---|
[72] | 6 | # ======== |
---|
| 7 | # plogd.sh |
---|
| 8 | # ======== |
---|
[2] | 9 | # |
---|
[85] | 10 | # --------------------------------------------------------------------------------------- |
---|
| 11 | # prints the most recent release of :file:`${IRCAAM_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}` |
---|
| 12 | # --------------------------------------------------------------------------------------- |
---|
[2] | 13 | # |
---|
| 14 | # SYNOPSIS |
---|
| 15 | # ======== |
---|
| 16 | # |
---|
| 17 | # :: |
---|
| 18 | # |
---|
| 19 | # $ plogd.sh action |
---|
| 20 | # |
---|
| 21 | # |
---|
| 22 | # DESCRIPTION |
---|
| 23 | # =========== |
---|
| 24 | # |
---|
[85] | 25 | # ``plogd.sh`` prints the most recent release of :file:`${IRCAAM_LOG}/{action}.log.{YYYYMMDDTHHMMSSZ}`. |
---|
[2] | 26 | # |
---|
| 27 | # It uses a2ps application. |
---|
| 28 | # |
---|
[85] | 29 | # Print is done on the default printer. |
---|
[2] | 30 | # |
---|
| 31 | # SEE ALSO |
---|
| 32 | # ======== |
---|
[12] | 33 | # |
---|
[82] | 34 | # :ref:`ircaam_profile.sh` |
---|
[12] | 35 | # |
---|
[82] | 36 | # :ref:`dlogd.sh` |
---|
[2] | 37 | # |
---|
[82] | 38 | # :ref:`elogd.sh` |
---|
[12] | 39 | # |
---|
[82] | 40 | # :ref:`tlogd.sh` |
---|
[2] | 41 | # |
---|
| 42 | # EVOLUTIONS |
---|
| 43 | # ========== |
---|
| 44 | # |
---|
| 45 | # $Id$ |
---|
| 46 | # |
---|
[69] | 47 | # - fplod 20100226T151441Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 48 | # |
---|
| 49 | # * replace ????-??-??T??:??:??Z by ????????T??????Z |
---|
| 50 | # |
---|
[2] | 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 |
---|
[77] | 60 | AIX|IRIX64) |
---|
| 61 | echo " www : no specific posix checking" |
---|
| 62 | ;; |
---|
| 63 | *) |
---|
| 64 | set -o posix |
---|
| 65 | ;; |
---|
[2] | 66 | esac |
---|
[75] | 67 | unset system |
---|
[2] | 68 | # |
---|
[60] | 69 | LANG=POSIX |
---|
| 70 | # |
---|
[2] | 71 | command=$(basename ${0}) |
---|
| 72 | # |
---|
| 73 | if [ "${1}" = "" ] |
---|
| 74 | then |
---|
[77] | 75 | echo "${command} : eee : 1st parameter missing" >&2 |
---|
| 76 | exit 1 |
---|
[2] | 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 |
---|
[77] | 84 | echo "${command} : eee : ${tool} unavailable" >&2 |
---|
| 85 | exit 4 |
---|
[2] | 86 | fi |
---|
| 87 | unset tool |
---|
| 88 | unset status |
---|
| 89 | # |
---|
| 90 | systeme=`uname` |
---|
| 91 | # |
---|
[69] | 92 | log=$(find ${IRCAAM_LOG} -name "${1}.log.????????T??????Z" | sort | \ |
---|
[2] | 93 | tail -n 1) |
---|
| 94 | tmp=${?} |
---|
| 95 | if [ ${tmp} -eq 0 ] |
---|
| 96 | then |
---|
[77] | 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 |
---|
[2] | 106 | else |
---|
[77] | 107 | exit 1 |
---|
[2] | 108 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.