Merge branch 'release-2.140.93'
[feisty_meow.git] / examples / os_related / user_sudoing.sh
1
2 # if this script is run as sudo, then at some point it may be useful to become another
3 # user, in order to run something from within their context.  this is one way to do it
4 # with a semi-interactive set of steps...
5 sudo -u chronical bash <<eof
6 echo hello this is \$USER
7 echo we be in \$(pwd)
8 echo "where you at?"
9 eof
10
11 # this can also be done by running a script with all those commands in it.
12 sudo -u chronical bash /home/chronical/thing_to_run_as_chronical.sh
13