From 1bd81ec6308f16a1b927f1def1b8addc108d2c2c Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Wed, 25 Aug 2021 10:45:28 +0000 Subject: [PATCH] [example scripts]: fix case when logfile contains a space character --- example-scripts/log_to_csv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example-scripts/log_to_csv.sh b/example-scripts/log_to_csv.sh index 6dc11b5f..995562d0 100755 --- a/example-scripts/log_to_csv.sh +++ b/example-scripts/log_to_csv.sh @@ -20,13 +20,13 @@ if test $# -lt 1; then exit 1 fi -if test ! -f $1; then +if test ! -f "$1"; then echo "error: expecting a log file as the first argument" exit 1 fi # Figure out a unique file name. -out_file_base="$(basename $1)" +out_file_base=$(basename "$1") counter=0 while test -e "${out_file_base}.${counter}.csv"; do counter=`expr ${counter} + 1` @@ -63,4 +63,4 @@ lnav -nq -d /tmp/lnav.err \ SELECT start_line FROM helper) and (SELECT max_line FROM helper)" \ -c ':write-csv-to $OUT_FILE' \ -c ":save-session" \ - $1 + "$1"