0

I wanted to set up a script that switches users and runs that command as that other user.

so example

sudo su myFavoriteUser && /run/command/as/myFavoriteUser

Any help would be appreciated.

Thanks, Sahr

Sahr
  • 1
  • 1
  • 4
    Possible duplicate of [su options - running command as another user](https://unix.stackexchange.com/questions/1087/su-options-running-command-as-another-user) .... always do research before asking a question ... did you google ... bash execute script as another user ... why do research ? it makes you far more productive and independent – Scott Stensland Aug 15 '19 at 17:29
  • 2
    I agree with the above comment but since Sahr is a new user, I'll suggest to him to look at the option `-c` for `su` – unxnut Aug 15 '19 at 17:37

0 Answers0