According to the man page for popen() I am opening a /bin/sh...Is there a way I can overload this behavior to open a /bin/bash shell and interact with BASH shell scripts? O
Probably the simplest is to have a small sh script which in turn invokes your bash script like so:
#!/bin/sh exec bash yourscript.sh "$@"
Or you can forgo popen and implement your own popen with fork() and execl().