Created
August 22, 2012 17:53
-
-
Save anonymous/3427922 to your computer and use it in GitHub Desktop.
stdin
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
#!/bin/bash | |
print=0 | |
while read line; do | |
echo "CERR: $line" 1>&2 | |
if [[ "$(echo $line | cut -d':' -f3)" == "opencyc_jac" ]]; then | |
echo "CERR: to cyc: $(echo "$line" | cut -d':' -f4-)" 1>&2 | |
echo "$line" | cut -d':' -f4- | |
fi | |
done | ./run-cyc.sh | while read oline; do | |
echo "CERR: $oline" 1>&2 | |
if [[ -n "$(echo $oline | grep "^CYC")" ]]; then | |
print=1 | |
fi | |
if [[ $print == 1 ]] && [[ -z $(echo $oline | grep '^at') ]]; then | |
echo "CERR: from cyc: $oline" 1>&2 | |
echo "PRIVMSG #uakroncs :$oline" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment