#!/bin/bash
su ajorge -c 'touch test0; touch test1'
####
Both test0 and test1 were created by user ajorge and owned by him. Don't be afraid of scripting inside a script, but watch carefully for what escape chars will evaluate to when it's all over. It's good practice to prefix every command with echo while testing so it prints what it would have done rather than just doing it.
David Smith wrote:
I'd like to be Borne Again in a script running as root. How can I change
to a different user (su won't work) during execution, like setuid(int)
does in C?
--Dave
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list
