Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/convert.sh
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-09 20:36:05 +0200
committerErich Eckner <git@eckner.net>2018-04-09 20:36:05 +0200
commita0be2ce2bfc03dbfd403cf81236fecffa16811e5 (patch)
tree4d2bfc150e2fcd9c387e2464df1334a6a8ec6724 /convert.sh
parent0d8a7030ff123c7197251f75415a44ce1de74bda (diff)
convert.sh: switch order of arguments to avoid race condition
Diffstat (limited to 'convert.sh')
-rwxr-xr-xconvert.sh13
1 files 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 '
/^<font size="2">/{
s@^<font size="2">(\([^)]\+\))</font><b> @\1 @
@@ -89,7 +85,6 @@ elif [ "$1" = 'html' ]; then
else
cat
fi | \
- sponge | \
sed '
s/([^()]*@[^()]*) //
' | \