I want to run the command as a non-root user when running script (rc.local). The command I want to execute is actually an alias for the root user -bb_profile. I tried to use
su - myuser -c aliased_cmd
but it does not work. If I just type
su - myuser
it works fine, but obviously this does not fit in the actual script. Of course, I could copy the aliases and functions that I would like to use in the actual rc.local file, but that seems a little silly ... maybe there is an option that I don't know about, or a way to use sudo for this?
Jesse source share