Scripting problem [message #97125] |
Sun, 16 December 2001 09:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Kilmarac
Messages: 1 Registered: December 2001
|
Junior Member |
|
|
Greetings,
Im trying to get a script, which runs as the user who owns it, to run either as a different user, or to run as root. Yes I am aware of the security implications of this, but I need to script to write to a file from the web, thats owned differently.
How do I do that?
----------------------------------------------------------------------
|
|
|
Re: Scripting problem [message #97129 is a reply to message #97125] |
Mon, 17 December 2001 06:06 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
JOHN
Messages: 182 Registered: April 1998
|
Senior Member |
|
|
You can use the su -c Unix command (runs as user_name).
#!/bin/sh
# This script Will run 2 commands as another user
su -c user_name "(echo 'Command1';echo 'Done')"
----------------------------------------------------------------------
|
|
|