I got a script that prompts for the password. For that I use echo <password> | script.sh
in my other script, so that the user inputs the password at the beginning and is not prompted for it anymore.
I want to know the exit status of the echo <password> | script.sh
command. I tried status=echo <password> | script.sh; echo $status
but it's just a newline. Also echo echo<password> | script.sh
isn't working.