scsh-users
[Top] [All Lists]

running s scsh script with changed user and group id

To: scsh-news@zurich.ai.mit.edu
Subject: running s scsh script with changed user and group id
From: Sven.Hartrumpf@FernUni-Hagen.de
Date: 24 Jul 2003 17:27:10 +0200
Organization: FernUni Hagen
I need to run a scsh script with changed user id and group id (the ones
of the file containing the script; Linux system, filesystem is nfs served
from a Solaris 2.9 box).

The naive way is:
chmod 755 myscript
chmod u+s myscript
chgrp g+s myscript

myscript starts like this:
#!/programs/free/bin/scsh -s
!#

(write (user-uid))
(write (user-gid))
...

This doesn't work - probably because of starting the scsh interpreter
in the first 2 magic lines. (no I don't want to change sticky bits of the
interpreter :-) )

What is the recommended way to achieve my goal?

Thanks in advance
Sven

<Prev in Thread] Current Thread [Next in Thread>