Created
July 13, 2013 07:58
-
-
Save mooperd/5989918 to your computer and use it in GitHub Desktop.
This file contains 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 | |
exec 3<> /dev/tcp/${1:-localhost}/4949 | |
printf "list" >&3 | |
printf "\r\n" >&3 | |
while read -ra line <&3 | |
do for word in "${line[@]}" | |
do printf 'fetch %s\n' "$word" | |
while read -r fline <&3 | |
do [[ $fline = . ]] && break | |
echo "got $fline"; | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment