Last active
May 10, 2017 16:46
-
-
Save ramn/5396741 to your computer and use it in GitHub Desktop.
IRC client in Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Communicate with an IRC channel from the shell | |
# | |
# Runs in background, writes messages to stdout in tty | |
# Depends on sic | |
TMPF=ircsession.tmp; CHAN='#testircfrombash'; ME=bot001; cat /dev/null > $TMPF; (tail -f $TMPF | sic -h irc.freenode.net -p 6667 -n $ME | while read MSG; do case "$MSG" in "$ME"*) echo ":j $CHAN" >> $TMPF;; "$CHAN"*) echo "$MSG";; esac; done;) & | |
# Then, to write to the channel: | |
echo "Hello all!" >> $TMPF | |
# or open a buffer to write many rows: | |
cat >> $TMPF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment