we are running script the the first command in it is
su (switch user)
and after that other command:
#!/bin/bash
su sys_osrqa
whoami
pwd
but when the script run, it asks for password, and after we enter the password (manually) the script stops and doesn't proceed to the following commands:
Password:
icsl0760>
ant that's it. The commands "whoami" and "pwd"are not executed.
sudoers
. – Rinzwind Aug 16 '18 at 10:04su sys_osrqa
will start an interactive shell for usersys_osrqa
- control won't return to your script until that shell is exited – steeldriver Aug 16 '18 at 11:41