I want to change the password of the Unix user through a shell script, but without being prompted to enter the old password.
That means I want to provide the old and new password in the shell script itself, such that during the prompt it will read it from the script file.
$> echo -e -n "oldpasswd\nnewpasswd\nnewpasswd" | passwdOr to make things a cleaner way, write a file with your passwords
and use the following command:
$> passwd < fileThe pipe and redirection operators are replacing the standard input with either the content of the file redirected, either the output of the command piped.