From a0be2ce2bfc03dbfd403cf81236fecffa16811e5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 9 Apr 2018 20:36:05 +0200 Subject: convert.sh: switch order of arguments to avoid race condition --- convert.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/convert.sh b/convert.sh index 6bc6288..6e37c7e 100755 --- a/convert.sh +++ b/convert.sh @@ -32,10 +32,8 @@ create_color() { # "time * | nick action" # we reformat other formats accordingly -if [ "$1" = 'tyzoid' ]; then - shift - channel="$1" - shift +if [ "$2" = 'tyzoid' ]; then + channel="$3" sed ' s/^\[\([^]]\+\)] \*\*\* Joins: \(\S\+\) .*$/\1 --> | \2 has joined '"${channel}"' / t @@ -45,10 +43,8 @@ if [ "$1" = 'tyzoid' ]; then t d ' -elif [ "$1" = 'html' ]; then - shift - channel="$1" - shift +elif [ "$2" = 'html' ]; then + channel="$3" sed -n ' /^/{ s@^(\([^)]\+\)) @\1 @ @@ -89,7 +85,6 @@ elif [ "$1" = 'html' ]; then else cat fi | \ - sponge | \ sed ' s/([^()]*@[^()]*) // ' | \ -- cgit v1.2.3