From fc86bcc4cd0707a05105240e3d392ab59aed2fce Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Sat, 8 Apr 2017 18:02:18 +0200 Subject: [PATCH] double quote find expression too --- backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index 4492db5..db1b2f9 100644 --- a/backup.sh +++ b/backup.sh @@ -21,7 +21,7 @@ done if [ -n "$MAX_BACKUPS" ] then - while [ $(find /backup -maxdepth 1 -name "*.sql.gz" | wc -l) -gt "$MAX_BACKUPS" ]; + while [ "$(find /backup -maxdepth 1 -name "*.sql.gz" | wc -l)" -gt "$MAX_BACKUPS" ]; do TARGET=$(find /backup -maxdepth 1 -name "*.sql.gz" | sort | head -n 1) echo "Backup $TARGET is deleted"