From c923f286acb3d0cf1f679c4a34c03ace26290ca0 Mon Sep 17 00:00:00 2001 From: thatgeekyweeb Date: Mon, 18 Oct 2021 04:00:00 -0400 Subject: [PATCH] refine --- README | 9 +++++---- morsh | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README b/README index 6462fe2..8cb83de 100644 --- a/README +++ b/README @@ -1,12 +1,13 @@ # Morsh -- The physical form of pure insanity. +-- Morse code puresh decoder/encoder ## Usage --- $ echo "" | ./mosrh - + +$ echo "sample" | ./morese + --- - -~ meeper is an amazing <>, they drive me to new limits +-- meeper is a really cool dude diff --git a/morsh b/morsh index c9b8b01..f34a8bd 100755 --- a/morsh +++ b/morsh @@ -1,5 +1,5 @@ #!/bin/sh -# -. --- - .. -.-. . -- . -- . . .--. . .-. +# -. --- - .. -.-. . / -- . / -- . . .--. . .-. # shellcheck disable=SC2086,SC1083,SC2154 # SC2086 - required for IFS replacement # SC1083 - required for eval @@ -28,7 +28,7 @@ unset bang; line=1; while read -r p || [ -n "$p" ]; do [ "$line" -eq 1 -o "$bang" ] 2>/dev/null && { # start comment check # this is basically a shitpost lol case "$p" in '#'!*) bang=" ";; - '#'*) p="${p#\#}"; printf '%sl: %s\n#' "${bang# }" "${line}" + '#'?-*|'#'?.*) p="${p#\#}"; printf '%sl: %s\n# ' "${bang# }" "${line}" bang=' ' # big hack to add newlines to start if >1 n1="0"; IFS=": "; for i in ${p}; do @@ -41,10 +41,10 @@ unset bang; line=1; while read -r p || [ -n "$p" ]; do n1=0 done ;; esac # this only converts morse - [ "$bang" ] && unset p + [ "$bang" ] && p="?" } case "$p" in - #"") ;; # skip empty lines + "") echo ;; # skip empty lines -*|.*) # for morse to ascii n1="0"; IFS=": "; for i in ${p}; do