| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# This file is part of the battery-stats package. |
| 4 |
# Copyright (C) 2002 Karl E. Jørgensen <[email protected]> |
| 5 |
# |
| 6 |
# This program is free software; you can redistribute it and/or modify |
| 7 |
# it under the terms of the GNU General Public License as published by |
| 8 |
# the Free Software Foundation; either version 2 of the License, or |
| 9 |
# (at your option) any later version. |
| 10 |
# |
| 11 |
# This program is distributed in the hope that it will be useful, |
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
# GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with this program; if not, write to the Free Software |
| 18 |
|
| 19 |
set -e |
| 20 |
|
| 21 |
if [ $# -eq 0 ] |
| 22 |
then |
| 23 |
files=`ls -1tr /var/log/battery-stats /var/log/battery-stats.[0-9]* 2>/dev/null` \ |
| 24 |
|| true |
| 25 |
else |
| 26 |
files="$@" |
| 27 |
fi |
| 28 |
|
| 29 |
for file in $files |
| 30 |
do |
| 31 |
case "$file" in |
| 32 |
*.gz) |
| 33 |
zcat $file |
| 34 |
;; |
| 35 |
*) |
| 36 |
cat $file |
| 37 |
esac |
| 38 |
done |
| 39 |
|