how can i pass a password automatically when a shell script is running.
i have shell script(runscript.sh) which call another shell script inside it as a different user.
runscript.sh contains
su - nemo -c "/bin/main_script.sh"
but when i execute "runscript.sh" it try to run main_script.sh and prompts for a password. so i have to give the password manually. is there a way so that the script automatically reads a password? or is there a way so it doesnot prompt for a password at all?
spawn is an expect command, or so I thought. There is a separate spawn daemon (see section 8 of the spawn manpage), but I can't say if that's what expect is using. I've never had cause to use expect, so it's best if you read the manual page, or online documentation, to understand it better.