in reply to how to su in a script ?
I can't help but notice you didn't say what the "job" was, that you needed to su, or sudo to, to accomplish.
If it's some recurring task. Perhaps there's a better tool to do that job. Such as cron. Which would mean, all you'd need to do is create a CRONJOB.
Frankly; I think that in this case, there are probably better tools already available to accomplish something that, where the need elevate user privileges is required. But if you DO need Perl, you will most certainly NOT want to automate the password-passing part (pre-fill that part).
Best wishes.
--Chris
¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH
|
|---|