From 4bbf43035b9403678d5722c5c9f8d2cbf47307b4 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Fri, 8 Mar 2013 12:47:22 +0000 Subject: [PATCH] ls -f is not portable (spotted by Benjamin Cohen) --- multicat_expire.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multicat_expire.sh b/multicat_expire.sh index e5de4a5..15f5dfd 100755 --- a/multicat_expire.sh +++ b/multicat_expire.sh @@ -35,7 +35,7 @@ DIR=$1 WANTED_CHUNKS=$2 cd "$DIR" -NB_CHUNKS=`ls -f *.ts | wc -l` +NB_CHUNKS=`ls -a -1 *.ts | wc -l` if test $NB_CHUNKS -gt $WANTED_CHUNKS; then ls -t *.ts | tail -n $(($WANTED_CHUNKS-$NB_CHUNKS)) | cut -d. -f 1 | xargs -I FILE sh -c "rm FILE.ts FILE.aux*" -- GitLab