Created
December 11, 2014 02:35
-
-
Save goldeneggg/600768b8ca1abd0e4f3a to your computer and use it in GitHub Desktop.
bash組込機能である /dev/tcp を使ってnetcat風の通信処理を行うサンプル(IRC)
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 | |
- | |
########################################################## | |
# IRCにJOINするサンプル | |
NICK="YOUR_NICK" | |
SERVER="YOUR_SERVER" | |
CHANNEL="YOUR_CHANNEL" | |
PORT=6667 | |
########################################################## | |
# Main | |
exec 3<>/dev/tcp/${SERVER}/${PORT} | |
echo "NICK ${NICK}" >&3 | |
echo "USER ${NICK} 8 * : ${NICK}" >&3 | |
echo "JOIN ${CHANNEL}" >&3 | |
cat <&3 | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment