I have an interactive program that runs stdin and stdout. I need to create wrapper that will send X to it\'s stdin, check that it prints Y and then redirects wrapper\'s stdin an
Assuming X and Y are files, and that you can invoke the program more than once:
#!/bin/bash test "`program
Or, to fail more verbosely:
#!/bin/bash if [[ `program
If you only invoke the program once, Expect is a much simpler alternative than reassigning standard file I/O on the fly.