.logout error

I need to run clean up on a user account at logout.
I have added .logout but on logout, I get an illegal variable name msg. I have changed shells from sh, which did not run the .logout, to csh and tcsh which does try to run .logout but gives the illegal variable name error.
When I run "sh .logout" it works fine. What is changing on logout and how do I fix this??
Thanks

Code:
#!/bin/tcsh -
ROT=$(/bin/date "+%b%d%y%H%M")
#CAPTOOL=/usr/local/bin/mencoder
#STORE=/my/dir
/usr/local/bin/mencoder mf://xray*.jpg -mf fps=10 -o xray$ROT.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
/bin/rm /my/dir/xray*.jpg
 
Start replacing the first non commented line with this
Code:
set ROT = `/bin/date "+%b%d%y%H%M"`
 
ale said:
Start replacing the first non commented line with this
Code:
set ROT = `/bin/date "+%b%d%y%H%M"`

It's tcsh shell so it's:
Code:
setenv ROT `/bin/date "+%b%d%y%H%M"`
 
SirDice said:
It's tcsh shell so it's:
Code:
setenv ROT `/bin/date "+%b%d%y%H%M"`
It depends on what the script has to do.
Considering that this should be run on logout, it doesn't look like an environment variable it's needed, a shell one should be enough.
 
Back
Top