I'm writing a shell script to change a user's password. I tried to use the passwd command, but that command always asks for the old and new passwords to be typed; it won't accept them from my script.Is there a way to change the user's password in a shell script, with the old and new password coming from e.g., variables?
using script function rather than keyboard input
shell;shell script;x11;keyboard shortcuts;keyboard