Can I connect a UNIX socket as STDIN for processing in bash?

Can a UNIX socket be connected as STDIN to a command or process?

Something like:

/var/run/input.sock | command

      

+3


source to share


1 answer


You can use socat:

socat -T 3 unix-connect:/var/run/input.sock stdout | command

      

Installing socat:

CentOS:

sudo yum --enablerepo epel install socat

      



Ubuntu:

sudo apt-get install socat

      

Additional Information:

http://www.dest-unreach.org/socat/doc/socat.html

http://technostuff.blogspot.com/2008/10/some-useful-socat-commands.html

+1


source







All Articles