6
I have a shell script that I need to run some commands with a linux user, and some other commands with another user.
Something more or less like this:
#!/bin/bash echo 'rodando com usuário A' comando1 comando2 comando3 echo 'Rodando com Usuário B' sudo su comando4
The problem is that I would like to perform all commands in the same script. But once the command with the second user is started, a new session bash
is initiated.
It is possible to execute commands with 2 different users in the same script?
Well appreciated your help, I will also test your suggestion. Thank you.
– eliocapelati