in reply to run perl -e programmatically as another user

That would be my strategy as long as you remember a few caveats:

  1. The first and most obvious is that the sudoers file is properly configured to accomodate what you are trying to do.
  2. Pay close attention to the details of file/directory permissions and ensure that whereever you are opening files you have proper permissions as the user the command is running as.
  3. Answer yourself: do you really need a script to execute a script?
That last point I bring up as a artifact of my not understanding from the small context you've given why you feel the need to do this. Would cron do the same thing for you (a crontab in the non-priveleged user's account)?


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
  • Comment on Re: run perl -e programmatically as another user