marvvin

IRC bot
Log | Files | Refs | README | LICENSE

commit c8b433b38842510c45715c54bea5768177e198a1
parent 6f597cae60838259000460bc2abe00f8652d13d8
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 28 Feb 2022 19:39:08 +0000

Always use printf in shell. Fuck GNU echo.

Diffstat:
Mmain.sh | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main.sh b/main.sh @@ -46,9 +46,9 @@ do tee $inlog /dev/stderr | \ while read -r line do - export LINE="$(echo "$line" | sed 's/:[^ ]* //')" - export FROM="$(echo "$line" | grep -o '^:[^ ]*')" - export NICK="$(echo "$FROM" | sed -E 's/[:!]*([^:!]*).*/\1/')" + export LINE="$(printf '%s\n' "$line" | sed 's/:[^ ]* //')" + export FROM="$(printf '%s\n' "$line" | grep -o '^:[^ ]*')" + export NICK="$(printf '%s\n' "$FROM" | sed -E 's/[:!]*([^:!]*).*/\1/')" ./handler.rc done >/dev/null | tee $input