Scripting question

2001-01-08 Thread Nathan Ridge

I am trying to write a script for a couple of novice admins that changes
shell to bash from false, logs in, runs elm from where they can purge
certain emails from a users mailbox and then exit to change the shell back
to false. So far I have:

#!/bin/bash
USR=$1
usermod -s /bin/bash $USR
su - $USR
elm
usermod -s /bin/false $USR

but when the su - changes accounts the script stops, any help appreciated.

Regards
Nathan 


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Scripting question

2001-01-08 Thread Tamas TEVESZ

On Tue, 9 Jan 2001, Nathan Ridge wrote:

  su - $USR

su - $USR -c "elm whatever"


-- 
[-]
``And there are plenty of other innovative pieces of software such as Napster
and ICQ.'' -- comment on ``Systems Software Research is Irrelevant'' at
http://freshmeat.net/news/2000/08/05/965534399.html


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]