From b0d0f11d09687de14f28c93ce91f69953a3996c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= <jbb@kaidan.im> Date: Wed, 15 May 2024 22:44:20 +0200 Subject: [PATCH] Fix help check --- fucopy.sh | 2 +- fudist.sh | 2 +- fufixpdf.sh | 2 +- fuxournalexport.sh | 2 +- fuzip.sh | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fucopy.sh b/fucopy.sh index 92aa57e..c746e06 100755 --- a/fucopy.sh +++ b/fucopy.sh @@ -1,6 +1,6 @@ #! /bin/sh -if [ $# -lt 1 ] || [ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]; then +if [ $# -lt 1 ] || ([ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]); then printf "Usage: %s <pattern>\n" $(basename $0) >&2 printf "Supply a pattern matching files to be copied, e.g. '*.pdf'\n" >&2 printf "Execute within the directory containing 'grades.csv'\n" >&2 diff --git a/fudist.sh b/fudist.sh index 6323f03..b00e7e3 100644 --- a/fudist.sh +++ b/fudist.sh @@ -1,6 +1,6 @@ #! /bin/sh -if [ $# -lt 1 ] || [ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]; then +if [ $# -lt 1 ] || ([ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]); then printf 'Usage: %s [FILE]...\n' "$(basename $0)" >&2 printf 'Supply file(s) to be distributed into the respective Submission attachment(s)\n' >&2 printf "Execute within the directory containing 'grades.csv'\n" >&2 diff --git a/fufixpdf.sh b/fufixpdf.sh index 177518f..87a34d6 100755 --- a/fufixpdf.sh +++ b/fufixpdf.sh @@ -1,6 +1,6 @@ #! /bin/sh -if [ $# -ne 0 ] || [ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]; then +if [ $# -ne 0 ] || ([ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]); then printf "Usage: %s\n" $(basename $0) >&2 printf "Execute within the directory containing 'grades.csv'\n" >&2 exit 1 diff --git a/fuxournalexport.sh b/fuxournalexport.sh index 87ed5c0..cd379ef 100755 --- a/fuxournalexport.sh +++ b/fuxournalexport.sh @@ -1,7 +1,7 @@ #! /bin/sh xournal=${XOURNAL:-xournalpp} -if [ $# -ne 1 ] || [ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]; then +if [ $# -ne 1 ] || ([ ! -f 'grades.csv' ] && [ ! -f 'grades.xls' ]); then printf "Usage: %s <list of suffix(es)>\n" $(basename $0) >&2 printf "Supply a suffix to be appended to the name of the exported file\n" >&2 printf "E.g., %s '_graded'\n" $(basename $0) >&2 diff --git a/fuzip.sh b/fuzip.sh index 5988eae..cb9c96b 100755 --- a/fuzip.sh +++ b/fuzip.sh @@ -1,10 +1,10 @@ #! /bin/sh dir=$1 -if [ $# -lt 2 ] || [ ! -f "$dir/grades.csv" ] && [ ! -f "$dir/grades.xls" ]; then +if [ $# -lt 2 ] || ([ ! -f "$dir/grades.csv" ] && [ ! -f "$dir/grades.xls" ]); then printf "Usage: %s <directory> <pattern1> [pattern2] ...\n" $(basename $0) >&2 printf "Supply a pattern matching files to be added to the zip, e.g. '*.pdf'\n" >&2 - printf "Execute within the directory containing 'grades.csv'\n" >&2 + printf "Execute on the directory containing 'grades.csv'\n" >&2 exit 1 fi -- GitLab