RHEL, scripting an su

When I write a script, and in the script I do a

su - user

Open in new window


None of the other commands in the script are executed.

How do I get the other commands to be executed
Los Angeles1Asked:
Who is Participating?
 
TintinConnect With a Mentor Commented:
Assuming you are doing this as root:

su - user -c "command"

Open in new window


otherwise use sudo.
0
 
omarfaridCommented:
can you show your script?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.