The easiest way is to make the material that should be run as another user a separate script and invoke it using the -c option in su, for example, su -c otherscript userid .
You can do this as a โhere scriptโ with << EOF , but I have never tried it.
source share