I\'d like to be able to inject an initial command into the launching of an interactive process, so that I can do something like this:
echo \"initial command\
This is easy to do with the program "expect" which is intended to let you write scripts to interact with programs.
I tested this by writing an expect script bc.exp to launch the calculator "bc" and send it the command "obase=16" to put it into hexadecimal output mode, and then turn over control to me.
The script (in a file named bc.exp) is
spawn bc
send "obase=16\n"
interact {
\003 exit
}
One runs it with
expect bc.exp