summaryrefslogtreecommitdiff
path: root/savelog
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-04-29 17:00:22 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-04-29 17:00:22 +0400
commit8fb496f15292ac92beeab0057329442e3d443052 (patch)
treef9ea3f24d60eea6a711428b4e0059105954f36b9 /savelog
parentd41f0dcff5d1aa9ab79ba12adea477d36b1fa401 (diff)
parentca21faeb076f64d82b4b7b16b63d7ea747390b28 (diff)
downloaddebianutils-8fb496f15292ac92beeab0057329442e3d443052.tar.gz
Merge git://git.debian.org/users/clint/debianutils
Diffstat (limited to 'savelog')
-rw-r--r--savelog10
1 files changed, 8 insertions, 2 deletions
diff --git a/savelog b/savelog
index 1a0f305..33b91f0 100644
--- a/savelog
+++ b/savelog
@@ -299,9 +299,15 @@ while [ $# -gt 0 ]; do
if [ -n "$forceclean" ]; then
cycle=$(( $count - 1))
if [ -z "$COMPRESS" ]; then
- rm -f -- `ls -t -- $newname.[0-9]* | sed -e 1,${cycle}d`
+ list=$(ls -t -- $newname.[0-9]* 2>/dev/null | sed -e 1,${cycle}d)
+ if [ -n "$list" ]; then
+ rm -f -- $list
+ fi
else
- rm -f -- `ls -t -- $newname.[0-9]*$DOT_Z | sed -e 1,${cycle}d`
+ list=$(ls -t -- $newname.[0-9]*$DOT_Z 2>/dev/null | sed -e 1,${cycle}d)
+ if [ -n "$list" ]; then
+ rm -f -- $list
+ fi
fi
fi