From 4b32ee3daa672ee1af5bc279cd8406b7596900c8 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 30 Oct 2019 23:50:19 -0400 Subject: [PATCH] removed all shellcheck messages from shell scripts --- bin/c+ | 2 +- bin/c- | 2 +- bin/fcomplete | 2 +- bin/findall | 4 ++-- bin/i+ | 2 +- bin/i- | 2 +- bin/jmpsrc | 4 ++-- bin/no-c++ | 2 +- bin/pfind | 2 +- bin/pickfile | 2 +- bin/picktag | 10 +++++----- bin/w+ | 2 +- bin/x+ | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bin/c+ b/bin/c+ index f50e5d4..5dbd8de 100755 --- a/bin/c+ +++ b/bin/c+ @@ -1,5 +1,5 @@ #!/bin/sh -case "$(lang "$file")" in +case "$(lang "${file:?}")" in C|JavaScript) sed 's/^/\/\//g' "$@" ;; *) sed 's/^/#/g' "$@" ;; diff --git a/bin/c- b/bin/c- index e1f6991..12524f4 100755 --- a/bin/c- +++ b/bin/c- @@ -1,5 +1,5 @@ #!/bin/sh -case "$(lang "$file")" in +case "$(lang "${file:?}")" in C|JavaScript) sed 's/^\/\///g' "$@" ;; *) sed 's/^#//g' "$@" ;; diff --git a/bin/fcomplete b/bin/fcomplete index 2575387..63a2122 100755 --- a/bin/fcomplete +++ b/bin/fcomplete @@ -2,5 +2,5 @@ orig="$1" path="${orig%/*}" file="${orig##*/}" -[ "$path" == "$file" ] && path="." +[ "$path" = "$file" ] && path="." printf "%s" "$(find "$path" -path "$path/$file*" | pick "$path/$file")" diff --git a/bin/findall b/bin/findall index cc116ee..3de5914 100755 --- a/bin/findall +++ b/bin/findall @@ -3,8 +3,8 @@ pattern='' dir='.' usage(){ - echo "Usage: pfind DIR PATTERN [FLAGS]" - echo "Usage: pfind PATTERN" + echo "Usage: findall DIR PATTERN [FLAGS]" + echo "Usage: findall PATTERN" exit 1 } diff --git a/bin/i+ b/bin/i+ index 13a0f95..2b12bac 100755 --- a/bin/i+ +++ b/bin/i+ @@ -1,5 +1,5 @@ #!/bin/sh -case "$(lang "$file")" in +case "$(lang "${file:?}")" in ML|Python|Ruby) sed 's/^/ /g' "$@" ;; *) sed 's/^/ /g' "$@" ;; diff --git a/bin/i- b/bin/i- index 470a5d2..f065505 100755 --- a/bin/i- +++ b/bin/i- @@ -1,5 +1,5 @@ #!/bin/sh -case "$(lang "$file")" in +case "$(lang "${file:?}")" in ML|Python|Ruby) sed -E 's/^( ?| ? ?)//g' "$@" ;; *) sed -E 's/^( ?| ? ? ? ?)//g' "$@" ;; diff --git a/bin/jmpsrc b/bin/jmpsrc index 0f6b342..725e515 100755 --- a/bin/jmpsrc +++ b/bin/jmpsrc @@ -2,9 +2,9 @@ filename=$(basename -- "$file") extension="${filename##*.}" -if [ "$extension" == "c" ]; then +if [ "$extension" = "c" ]; then filename="${filename%.*}.h" -elif [ "$extension" == "h" ]; then +elif [ "$extension" = "h" ]; then filename="${filename%.*}.c" fi diff --git a/bin/no-c++ b/bin/no-c++ index e3fc6f1..b62db57 100755 --- a/bin/no-c++ +++ b/bin/no-c++ @@ -1,2 +1,2 @@ #!/bin/sh -sed 's_\/\/\(.*\)$_\/*\1 *\/_g' +sed "s_//\(.*\)\$_/*\1 */_" diff --git a/bin/pfind b/bin/pfind index a44a5b3..5f4a64a 100755 --- a/bin/pfind +++ b/bin/pfind @@ -1,6 +1,6 @@ #!/bin/sh path="$PWD" -while [[ "$path" != "" ]]; do +while [ "$path" != "" ]; do find "$path" -maxdepth 1 -mindepth 1 "$@" path="${path%/*}" done diff --git a/bin/pickfile b/bin/pickfile index e04c77d..b0ffe3a 100755 --- a/bin/pickfile +++ b/bin/pickfile @@ -5,5 +5,5 @@ if [ "$#" -ne 1 ]; then fi export PICKTITLE="Pick File ($PWD)" -file="$(find $1 -not -path '*/\.*' -type f | sed 's|^\./||' | pick)" +file="$(find "$1" -not -path '*/\.*' -type f | sed 's|^\./||' | pick)" [ "" != "$file" ] && edit "$file" diff --git a/bin/picktag b/bin/picktag index 8901ba2..378d65a 100755 --- a/bin/picktag +++ b/bin/picktag @@ -12,24 +12,24 @@ usage(){ exit 1 } -if [ "" == "$TAGFILE" ] || [ "" == "$ACTION" ]; then +if [ "" = "$TAGFILE" ] || [ "" = "$ACTION" ]; then usage fi printtags(){ - cat "$TAGFILE" | grep -v '^!' | cut -f1 | uniq + grep -v '^!' < "$TAGFILE" | cut -f1 | uniq } print(){ tag="$(printtags | pick "$TAG")" - [ "" == "$tag" ] && tag="$TAG" + [ "" = "$tag" ] && tag="$TAG" printf "%s" "$tag" } fetch(){ - if [ "" == "$TAG" ]; then + if [ "" = "$TAG" ]; then TAG=$(printtags | pick) - [ "" == "$TAG" ] && exit + [ "" = "$TAG" ] && exit fi file=$(awk -v TAG="$TAG" ' BEGIN { FS = "[\t]+" } diff --git a/bin/w+ b/bin/w+ index c4867a4..2054a28 100755 --- a/bin/w+ +++ b/bin/w+ @@ -1,2 +1,2 @@ #!/bin/sh -chmod +w "$file" \ No newline at end of file +chmod +w "${file:?}" \ No newline at end of file diff --git a/bin/x+ b/bin/x+ index 0ff7733..d679c70 100755 --- a/bin/x+ +++ b/bin/x+ @@ -1,2 +1,2 @@ #!/bin/sh -chmod +x "$file" \ No newline at end of file +chmod +x "${file:?}" \ No newline at end of file -- 2.52.0