diff options
author | tv <tv@krebsco.de> | 2020-03-17 20:06:22 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-03-17 20:06:56 +0100 |
commit | 3493cd74a1f6942566fbad4b89f4d3c84f964868 (patch) | |
tree | a226ab5af8d8914642c4de47763b85eb1635c863 /krebs | |
parent | cd268ca24967733172dbe5c3fe62fefbbdf80e44 (diff) |
irc-announce: fix more portable cat2
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/5pkgs/simple/irc-announce/default.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/krebs/5pkgs/simple/irc-announce/default.nix b/krebs/5pkgs/simple/irc-announce/default.nix index dea30a056..a90814aa9 100644 --- a/krebs/5pkgs/simple/irc-announce/default.nix +++ b/krebs/5pkgs/simple/irc-announce/default.nix @@ -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 }'; } |