I asked this question and doing echo pass | cmd and cmd <<< pass do not work with mysql and another app i tried.
One guy comments that passwords are through the terminal and not stdin, that sounds secure. How do i do that? using bash, .NET or C++?
I asked this question and doing echo pass | cmd and cmd <<< pass do not work with mysql and another app i tried.
One guy comments that passwords are through the terminal and not stdin, that sounds secure. How do i do that? using bash, .NET or C++?
Maybe something like the following can help...
expect -c 'spawn mysql -uroot -p; expect assword; send "toor\n"; interact'
...though I'm not sure I understood correctly your question.