References:
- http://www.xappsoftware.com/wordpress/2013/10/10/how-to-run-socat-on-mac-os-x/
- http://scott.cranton.com/2011/04/socat-is-so-cool.html
- http://justcheckingonall.wordpress.com/2009/06/09/howto-vsp-socat/
- http://buhadram.wordpress.com/2008/10/07/some-useful-socat-commands/
Running socat on Mac OS X
Install socat
sudo port install socatCreate a pair of VSP (Virtual Serial Port)
socat -d -d pty,raw,echo=0 pty,raw,echo=02014/08/07 01:40:56 socat[74896] N PTY is /dev/ttys0012014/08/07 01:40:56 socat[74896] N PTY is /dev/ttys0022014/08/07 01:40:56 socat[74896] N starting data transfer loop with FDs [3,3] and [5,5]Open a new terminal and enter
sudo cat /dev/ttys001Open another terminal and enter
sudo echo "Hello World" > /dev/ttys002On the first terminal you will see the string “Hello World”.