i want to change the password of root by non-root user using shell file.
i am trying
echo user_password | sudo passwd --stdin root
here user_password is the password entered by the user
it works fine from the command line, but from shell i am trying
echo $1 | sudo passwd --stdin root
and it just prints the
$1 | sudo passwd --stdin root
solution to this problem will be highly appreciated.