I'm using Solaris SunOS 5.10 and I need to switch user while executing a bash shell script providing su or sudo with user-name and password I have tried the below command
echo -e "mqm\n" | sudo -S "command"
But i didn't get how this command will know the user i want to switch to and also when i try it it says wrong password
What is really want to do is to switch the user within my script then run anther script after switching because the first user doesn't have permission to run mq commands
Thanks