mirror of https://dicksdeathabove.xyz/~mia/morsh
refine
This commit is contained in:
parent
dc07f0d2af
commit
c923f286ac
9
README
9
README
|
@ -1,12 +1,13 @@
|
||||||
# Morsh
|
# Morsh
|
||||||
- The physical form of pure insanity.
|
-- Morse code puresh decoder/encoder
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
---
|
---
|
||||||
$ echo "<your morse code here>" | ./mosrh
|
$ echo "<your morse code here>" | ./mosrh
|
||||||
<your translated hell here>
|
<decoded text here>
|
||||||
|
$ echo "sample" | ./morese
|
||||||
|
<encoded text here>
|
||||||
---
|
---
|
||||||
|
|
||||||
|
-- meeper is a really cool dude
|
||||||
~ meeper is an amazing <>, they drive me to new limits
|
|
||||||
|
|
8
morsh
8
morsh
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -. --- - .. -.-. . -- . -- . . .--. . .-.
|
# -. --- - .. -.-. . / -- . / -- . . .--. . .-.
|
||||||
# shellcheck disable=SC2086,SC1083,SC2154
|
# shellcheck disable=SC2086,SC1083,SC2154
|
||||||
# SC2086 - required for IFS replacement
|
# SC2086 - required for IFS replacement
|
||||||
# SC1083 - required for eval
|
# 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
|
[ "$line" -eq 1 -o "$bang" ] 2>/dev/null && { # start comment check # this is basically a shitpost lol
|
||||||
case "$p" in
|
case "$p" in
|
||||||
'#'!*) bang=" ";;
|
'#'!*) bang=" ";;
|
||||||
'#'*) p="${p#\#}"; printf '%sl: %s\n#' "${bang# }" "${line}"
|
'#'?-*|'#'?.*) p="${p#\#}"; printf '%sl: %s\n# ' "${bang# }" "${line}"
|
||||||
bang='
|
bang='
|
||||||
' # big hack to add newlines to start if >1
|
' # big hack to add newlines to start if >1
|
||||||
n1="0"; IFS=": "; for i in ${p}; do
|
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
|
n1=0
|
||||||
done ;;
|
done ;;
|
||||||
esac # this only converts morse
|
esac # this only converts morse
|
||||||
[ "$bang" ] && unset p
|
[ "$bang" ] && p="?"
|
||||||
}
|
}
|
||||||
case "$p" in
|
case "$p" in
|
||||||
#"") ;; # skip empty lines
|
"") echo ;; # skip empty lines
|
||||||
-*|.*)
|
-*|.*)
|
||||||
# for morse to ascii
|
# for morse to ascii
|
||||||
n1="0"; IFS=": "; for i in ${p}; do
|
n1="0"; IFS=": "; for i in ${p}; do
|
||||||
|
|
Loading…
Reference in New Issue