From 5d7838f2b779a0369fd8c98c1abd1a6299d6dfc7 Mon Sep 17 00:00:00 2001 From: Julien (jvoisin) Voisin Date: Wed, 24 Feb 2016 17:29:00 +0100 Subject: Fix some smelly code Thanks to http://www.shellcheck.net --- php-malware-finder/phpmalwarefinder | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder index 99d9033..acad8a7 100755 --- a/php-malware-finder/phpmalwarefinder +++ b/php-malware-finder/phpmalwarefinder @@ -31,13 +31,13 @@ fi # before starting yara, check if the file one_line_trick() { - find $@ -type f -iname '*.ph*' -print0 | while IFS= read -r -d '' -r file; do - read lines words chars name <<< $(wc "$file") + find "$@" -type f -iname '*.ph*' -print0 | while IFS= read -r -d '' -r file; do + read -r lines _ chars _ <<< $(wc "$file") if [ "$lines" -le "2" ]; then # humm, 2 lines long file ? if [ "$chars" -ge "300" ]; then - echo TooShort $file + echo "TooShort $file" fi; fi; done; @@ -88,7 +88,7 @@ then exit 1 fi -if [ ! -e ${CONFIG_PATH} ] +if [ ! -e "${CONFIG_PATH}" ] then echo "${CONFIG_PATH} doesn't exist. Please give me a valid file." exit 1 @@ -100,7 +100,7 @@ then exit 1 fi -if [ ! -e ${NICE} ] +if [ ! -e "${NICE}" ] then echo "No nice program available. Please install ionice or nice." exit 1 @@ -108,6 +108,6 @@ fi OPTS="${OPTS} -r ${CONFIG_PATH}" -one_line_trick $@ +one_line_trick "$@" -${NICE} ${NICE_OPTS} $YARA $OPTS $@ +${NICE} ${NICE_OPTS} $YARA $OPTS "$@" -- cgit v1.3