]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed all shellcheck messages from shell scripts
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Oct 2019 03:50:19 +0000 (23:50 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 31 Oct 2019 03:50:19 +0000 (23:50 -0400)
13 files changed:
bin/c+
bin/c-
bin/fcomplete
bin/findall
bin/i+
bin/i-
bin/jmpsrc
bin/no-c++
bin/pfind
bin/pickfile
bin/picktag
bin/w+
bin/x+

diff --git a/bin/c+ b/bin/c+
index f50e5d4eecf436721289ee361a3afb3beda0c115..5dbd8de99e68f7f5a415622a7b5fff7c065a3397 100755 (executable)
--- 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 e1f6991bde12b15a1412eb8e6b4369116a2ea269..12524f485e5c62b52f25c98756cb41dcbf0835a0 100755 (executable)
--- 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' "$@" ;;
index 2575387393d622087ba03a68dae4eb785cce7094..63a21227531acc7c01d197dc0b5388b46acc165c 100755 (executable)
@@ -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")"
index cc116ee23263031573ba13be9e5732a561c29a1e..3de59146cd43634096ef5aaf039788bbc6c72389 100755 (executable)
@@ -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 13a0f954dc37fc1600ec4f8c4126bd267861ff31..2b12bac7a22755871946a20f8830bba737a081a2 100755 (executable)
--- 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 470a5d27be4c69777698e20f581ccfbdc1b22547..f065505cae464aff1f78bbc8dc00cd064fe04c6e 100755 (executable)
--- 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' "$@" ;;
index 0f6b3422f8d5edd4ac92f885233a0ce0dd92bfb7..725e51509ef1996c324c2e223f83c5abb1e27f48 100755 (executable)
@@ -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
 
index e3fc6f1f4de812560d071bc86a53686a78303cc2..b62db57cf2465eb62b73e33c90c06c0df1ccc0b0 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/sh
-sed 's_\/\/\(.*\)$_\/*\1 *\/_g'
+sed "s_//\(.*\)\$_/*\1 */_"
index a44a5b3d80edffc8b46224aa0b2b03a087b5b05f..5f4a64a2cc4bca5961530b97cc686b8390c3b394 100755 (executable)
--- 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
index e04c77d643355f9645aa7e1f61772290e73497f9..b0ffe3a06965f1d8497c28179b7142c697bf0708 100755 (executable)
@@ -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"
index 8901ba2de7c57f4716f9d6a5c2458e43a5e755f4..378d65abd1d854aa1ea232a7d0eea5ed44b6e5c2 100755 (executable)
@@ -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 c4867a4b529faab94611eb393102fe59127fcbf9..2054a28634042cd64644e6e93f3d7471c7836aa4 100755 (executable)
--- 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 0ff7733c5a0f78f4ded0961bcafc2313cc14937e..d679c70d3ed046eab2a282550cf6d6a7aff2a1ee 100755 (executable)
--- 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