# .logout error



## bluetick (Mar 4, 2009)

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


```
#!/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
```


----------



## ale (Mar 4, 2009)

Start replacing the first non commented line with this 

```
set ROT = `/bin/date "+%b%d%y%H%M"`
```


----------



## SirDice (Mar 5, 2009)

ale said:
			
		

> Start replacing the first non commented line with this
> 
> ```
> set ROT = `/bin/date "+%b%d%y%H%M"`
> ```



It's tcsh shell so it's:

```
setenv ROT `/bin/date "+%b%d%y%H%M"`
```


----------



## ale (Mar 5, 2009)

SirDice said:
			
		

> It's tcsh shell so it's:
> 
> ```
> 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.


----------

