irc-announce: fix more portable cat2

This commit is contained in:
tv 2020-03-17 20:06:22 +01:00
parent cd268ca249
commit 3493cd74a1

View File

@ -24,7 +24,12 @@ pkgs.writeDashBin "irc-announce" ''
# echo2 and cat2 are used output to both, stdout and stderr
# This is used to see what we send to the irc server. (debug output)
echo2() { echo "$*"; echo "$*" >&2; }
cat2() { (read x ; echo "$x" ; echo "$x" >&2) }
cat2() {
while read -r line; do
echo "$line"
echo "$line" >&2
done
}
# privmsg_cat transforms stdin to a privmsg
privmsg_cat() { awk '{ print "PRIVMSG "ENVIRON["IRC_CHANNEL"]" :"$0 }'; }