From 5f42af862d2b6ca76b1c66f64156beddceeab9ae Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 5 Jan 2014 05:51:27 -0600 Subject: [PATCH] Make checkbashsism (mostly) happy --- flag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flag b/flag index 0f3c38d..585bc08 100755 --- a/flag +++ b/flag @@ -40,7 +40,7 @@ hash_string() { echo "deadbeef" return 1 else - echo -n "${*}" | "${crc32_algo}" 2>/dev/null | awk '{print $1}' + printf "%s" "${*}" | "${crc32_algo}" 2>/dev/null | awk '{print $1}' return 0 fi } @@ -54,7 +54,7 @@ flagcache(){ fi if [ -z "${flag_hex}" ] then - flag_hex="$(hash_string "${myhost}")" && echo -e "${myhost}\t${flag_hex}" >> "${cache}" + flag_hex="$(hash_string "${myhost}")" && printf "%s\t%s\n" "${myhost}" "${flag_hex}" >> "${cache}" fi echo "${flag_hex}" } @@ -64,7 +64,7 @@ then flag_hex="$(cat "${HOME}/.flag")" fi -if [ -z "${flag_hex}" -a -f "/etc/flag" ] +if [ -z "${flag_hex}" ] && [ -f "/etc/flag" ] then flag_hex="$(cat "/etc/flag")" fi -- 2.42.0