Skip to content

Instantly share code, notes, and snippets.

View silverkorn's full-sized avatar

Danny Boisvert silverkorn

View GitHub Profile
@jadell
jadell / socket_file.sh
Created March 15, 2011 21:22
Read and write to a socket using only Bash
#!/bin/bash
#
# Bash must have been compiled with this ability: --enable-net-redirections
# The device files below do not actually exist.
# Use /dev/udp for UDP sockets
exec 3<>/dev/tcp/host/port
# Write to the socket as with any file descriptor
echo "Write this to the socket" >&3