So I have a question that I am sure someone smarter in scripting than me can answer. And maybe it has already been answered in another question. If it has, please direct me to that discussion.
I am trying to write a script that requires a sudo command. However I do not want it to prompt my user for the sudo password, as they are no sudoers. Is there anyway to su to my sudoer account within the script and run the rest of the commands and exit of the sudoer, without the user seeing anything?
Ideally, the script would look like this:
!/bin/bash
su "admin account"
sudo "command"
exit
instead I get...
su "admin account:
password prompt
sudo command
exit
I can't figure out what I need to add to my script to make this work.
Thanks, AG