summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-01-23 09:09:26 +0000
committerdavidovski <david@davidovski.xyz>2024-01-23 09:09:26 +0000
commitd8761db85b40f59117a24648c33a70bddb3416a7 (patch)
tree5f3925605ca0daeae8b65f94348d786e933f31ef
parent880957699c5acf7a2c18439b30bbcca125d15d4a (diff)
remove non-posix $''
-rwxr-xr-xtypr.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/typr.sh b/typr.sh
index 9474ee9..b9d5e6b 100755
--- a/typr.sh
+++ b/typr.sh
@@ -224,7 +224,8 @@ typr_redraw_line () {
}
typr_new_line () {
- [ -n "$entered_text" ] && entered_text="$entered_text"$'\n'
+ [ -n "$entered_text" ] && entered_text="$entered_text
+"
entered_text="${entered_text}${entered_line}"
typr_update_acc
@@ -270,8 +271,10 @@ typr_del_letter () {
# removes the last line, ignoring trailing whitespace
#
typr_remove_last_line() {
- t="${1%$'\n'}"
- printf "%s" "${1%$'\n'}" | while IFS= read -r line; do
+ t="${1%
+}"
+ printf "%s" "${1%
+}" | while IFS= read -r line; do
printf "%s\n" "$line"
done
}