diff --git a/README.md b/README.md index 7a74fb3..4655d19 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,4 @@ copy it into your gemini directory and make it executable of course ## Changelog * 2021-10-18: thrown together in an hour +* 2021-10-19: thrown through shellcheck diff --git a/index.gmi b/index.gmi index 89dd2db..cde4a19 100755 --- a/index.gmi +++ b/index.gmi @@ -1,10 +1,10 @@ #!/usr/bin/env bash -if [ -z $QUERY_STRING ]; then +if [[ -z "$QUERY_STRING" ]]; then printf "10 Please enter your name!\r\n" fi name=$QUERY_STRING printf "20 text/gemini\r\n" -printf "# Pronoun Dressing Room for ${name}\n" +printf "# Pronoun Dressing Room for %s\n" "$name" sentences=("I really enjoy spending time with OBJECTIVE." "NAME is really cool, I like OBJECTIVE." "POSESSIVEDT accent is nice." "That belongs to OBJECTIVE." "NAME did so well, SUBJECTIVE MSHAS every reason to be proud of REFLEXIVE.") @@ -17,7 +17,7 @@ pr_ref=("himself" "herself" "themselves" "xemself") cnt=0 for i in "${pr_sub[@]}"; do - printf "${i}:\n---\n" + printf "%s:\n---\n" "$i" for j in "${sentences[@]}"; do cursent="${j}" @@ -36,7 +36,7 @@ for i in "${pr_sub[@]}"; do cursent="${cursent//POSESSIVEDT/"${pr_psd[${cnt}]}"}" cursent="${cursent//POSESSIVE/"${pr_pos[${cnt}]}"}" cursent="${cursent//REFLEXIVE/"${pr_ref[${cnt}]}"}" - printf "${cursent^}\n" + printf "%s\n" "${cursent^}" done printf "\n"