How to customize Terminal greeting without modifying /etc/motd ?

simX

Unofficial Mac Genius
I know that I can customize the Terminal greeting (default is "Welcome to Darwin!") by modifying the file /etc/motd , but is there any way to do it without modifying that file – the solution would probably entail making some file in ~/Library/init/tcsh/ , but I don't know exactly what name to name the file.

I tried "motd.mine" on a hunch, but that didn't work. :( Any other suggestions?
 
you could create (or edit if you already have) login.mine in your ~/library/init/tcsh/ directory.

Note that this file is for commands you want executed when you open a new session, so if you just want some text displayed, you need to use the ECHO command.
 
I'm sure the above suggestions are fine, but it reminded me of an issue we encountered awhile ago and it caused us a few headaches to track down! If you ever try to use "cat" or "more" or the like to display a message upon login, be careful that this could cause trouble with non-interactive shells (eg connecting with an FTP or SCP client).

We found this when configuring the .login file on an IRIX box; I had setup the .login file to display how full the disk was and which users were over their quota every time a new terminal session was started. The solution was to insert a test to see if there was a prompt before sending text to the standard output.

The prompt test was as follows:


if ($?prompt) then
#insert your desired commands here
endif


Hope this prevents others from having to go through with the same troubleshooting as we did! :)
 
As has pretty much been said, you could just `echo <my motd>` in your ~/.tcshrc, and also `touch ~/.hushlogin` to ignore the system motd.

HTH....
 
I have not tried running any servers from OS X, but if things are handled differently then perhaps all is OK. The problems we ran into with IRIX were when we tried to use an SCP client, which I had considered to be tied in with SSH. The SCP client would basically just "hang." When inserting the prompt test, everything was back to normal.
 
Back
Top