You've probably already looked at using su ?

su project
./your_script


On Tue, 10 Jun 2003, Chris Staskewicz wrote:

> Hey Boston Perl Mongers.
>
> We use an in-house Unix function called "be" which allows one to change
> their user identity to something else.  For example, "user% be project"
> typed at the command-line in a shell will change my user identity to
> "project%" which will then allow me to "cd" to the project directory,
> read, write, and so on.  When I type "project% exit", my command prompt is
> changed back to "user%".
>
> Here's the problem.  I need to do a massive file conversion in our main
> project directory, and we want to do file conversions under the identity
> of the project "be" name (not as root).  (Aside -- We can run the thing as
> root, and do chmod to set the ownerships, timestamps, blah, blah, blah.
> But we're trying a non-root program first).  So the Perl script looks
> something like this:
>
>
> # loop over all project names
>
> # do some things
>
> $stat = system("be proj0");
>
> # convert files and somehow exit "be"
>
> # end loop
>
>
> Currently I'm running the Perl script at the command-line with a
> "./run.pl".  The problem is that once Perl hits the system call, the shell
> hangs until I manually type "exit".  Then the program chokes since all the
> code after the "be" call requires the permissions from "be".  Any ideas on
> passing the "be" info to Perl and stop this hanging?
>
> Thanks so much,
>
> Chris.
>
>  --------------------------------------------------------
>  Chris Staskewicz
>  Channing Laboratory - Brigham and Woman's Hospital
>  tel: 617.525.2575
>  fax: 617.525.2578
>  --------------------------------------------------------
>
>
> _______________________________________________
> Boston-pm mailing list
> [EMAIL PROTECTED]
> http://mail.pm.org/mailman/listinfo/boston-pm
>

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to