Article View: comp.sys.next.misc
Article #585Re: Three simple questions.. :)
From: Art Isbell
Date: Sat, 01 Aug 1992 17:14
Date: Sat, 01 Aug 1992 17:14
43 lines
2422 bytes
2422 bytes
In article <1992Jul31.231824.1753@resonex.com> zenon@resonex.com (Zenon Fortuna) writes:
>In article <1992Aug1.030126.13089@nmsu.edu> rscott@spock.NMSU.Edu (Joseph Good) writes:
>>
>>1) Is there a UNIX command to empty the recycler? I know that I am
>> just being completely lazy, but I would like to chunk anything that
>> I forgot, when I log out. Also, I know about the .login file, is
>> there a .logoff(out) file that will execute commands and stuff when
>> I log out?
>
>The Workspace has something like "LoginHook" and "LogoutHook", to execute
>own program(s) on start or termination.
>
>You can create a Shell-script, say, /usr/local/bin/emptyMyTrash:
> cd # to return to home directory
> /bin/rm -rf .NeXT/.NextTrash/*
>and declare:
>% dwrite loginwindow LogoutHook /usr/local/bin/emptyMyTrash
>
>This will empty your Recycler after terminating the Workspace application.
>You may generalize your emptyMyTrash script to work with mounted disks as well.
Unfortunately, one must be root to enable Log{in,out}Hooks. If you can get
root to cooperate and set up Log{in,out}Hooks that call users' individual
scripts, then individual users can have Log{in,out}Hooks do various
user-specific things. So a sample LoginHook might be:
#!/bin/sh
if [ -f /Users/$1/.loginHook ]; then
. /Users/$1/.loginHook
elif [ "$1" = "root" -a -f /.loginHook ]; then
. /.loginHook
fi
However, others have warned of certain security risks involved with
Log{in,out}Hooks (they are run as root, I guess), so use with caution.
--
Art Isbell Cubic Solutions
NeXT Registered Developer #745 NeXT software development and consulting
Email: isbell@cats.UCSC.EDU Voice: (408)335-1154
USmail: 95018-9442 Fax: (408)335-2515
Technical Details
Message-ID:
<15egorINN5om@darkstar.UCSC.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!swrinde!cs.utexas.edu!sun-barr!ames!agate!darkstar.UCSC.EDU!cats.ucsc.edu!isbellReferences:
<1992Aug1.030126.13089@nmsu.edu> <1992Jul31.231824.1753@resonex.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!swrinde!cs.utexas.edu!sun-barr!ames!agate!darkstar.UCSC.EDU!cats.ucsc.edu!isbell From: isbell@cats.ucsc.edu (Art Isbell) Newsgroups: comp.sys.next.misc Subject: Re: Three simple questions.. :) Message-ID: <15egorINN5om@darkstar.UCSC.EDU> Date: 1 Aug 92 17:14:03 GMT References: <1992Aug1.030126.13089@nmsu.edu> <1992Jul31.231824.1753@resonex.com> Organization: Cubic Solutions - NeXT software development and consulting Lines: 43 NNTP-Posting-Host: am.ucsc.edu