Is there a way to execute a bash script under the privileges of another user (automatically)? I think "sudo" is the right way, but I don't know how to automate the process.
E.g. I want to run something like this (user "bla" runs a process under "blub"):
sudo <the user under which i want to run the process> <path to script>