I am trying to do a script that will be able to read the input from a file or the output of a script (best).
For example: if I want to specify a password to a scp command
I have done a first script simmilar to this:
and piped this script script to the scp:
./sleep_pass | scp a.txt user@host:/path/
( the sleep 3 command was for waiting the scp to get a password prompt
I am not sure however that this is the way to do it
unfortunatley it's not working.
Another idea that I had was to writing to the tty: something like:
echo "pass" > /dev/pts/5... (but is not working either)
Do you have any ideas about this?
Can this be done... ( I am sure it can be done.. I am not sure that it's just as simple)
Thank you very much