how to write a script that will run commands after su, without using -c
Put the commands that you want to run as the other user into a separate file,
user2commands
, and then do
sudo su - user < user2commands
If you don’t want to have a separate file, consider:
sudo su - user << EOF commands to be run as the other user ︙ EOF