Enhancements to unix_instruments.sh

Basically implement https://gist.github.com/jonathanpenn/1402258/2e51b7783a01716f05d3e8d3a520dc67e9607053