Solved

RHEL, scripting an su

Posted on 2012-03-16
2
203 Views
Last Modified: 2012-03-16
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
0
Comment
Question by:Los Angeles1
2 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 37730861
Assuming you are doing this as root:

su - user -c "command"

Open in new window


otherwise use sudo.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37731124
can you show your script?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question