Currently I am logged in unix server using userid "bob". But i want to sudo as different user(masteruser) inside a script.
My current code is
echo password | sudo -S masteruser bash
In above line password is my password and masteruser is the user which i want to connect. But executing that line i am getting error "sudo: masteruser : command not found"
Can you please help me out for the same.