For an example i would like to login to mysql with a password. i KNOW i can use -pmypass but i want to learn how do i redirect stdin in bash. So my test is
But many programs, including MySQL, that read passwords don't actually read from stdin. Rather, they interact with the terminal directly. See Trick an application into thinking its stdin is interactive, not a pipe.