.hushlogin

.hushlogin

Post by MARSELLE%gmr... » Wed, 02 May 1990 17:03:00



The other day I read someone's suggestion to use a "make -f .hushlogin"
in the .login file to only print out /etc/motd when its last mod time
changes.  Since no further advice regarding what .hushlogin should look
like was provided, I did a little hacking.

If I use a .hushlogin which looks like this:

.hushlogin:     /etc/motd
        cat /etc/motd
        touch .hushlogin

I get:
Make: No arguments or description file.  Stop.

I thought it might have something to do with the '.' in the
first column, so I tried:

hushlogin:      /etc/motd
        cat /etc/motd
        touch .hushlogin hushlogin

which works fine, but uses a 2nd file "hushlogin".

If I put a backslash in front of the '.' like so:

\.hushlogin:    /etc/motd
        cat /etc/motd
        touch .hushlogin

it always cat's and touch'es.

Are there any "make" aces out there that know what's going on here?

BTW, I noticed that if you have a .hushlogin, the "You have mail"
message is also suppressed when you login, so I put the "mail"
command into my .login.

Also, even if you use "make -s -f .hushlogin" to suppress the make
chatter, make will still print out "`.hushlogin' is up to date"
when you log in and /etc/motd hasn't been changed.

I think I'll switch to someone else's suggestion and try:

cmp -s .hushlogin /etc/motd
if ($status) then
        cat     /etc/motd | tee .hushlogin
endif

then I won't have to deal with make.

____________________________________________________
|Jim Marselle           | Phone: (313) 986-1413    |

|Computer Science Dept. |                          |
|30500 Mound Road       |                          |
|Warren, MI  48090-9057 |                          |
----------------------------------------------------

 
 
 

.hushlogin

Post by MARSELLE%gmr... » Wed, 02 May 1990 17:14:00


The other day I read someone's suggestion to use a "make -f .hushlogin"
in the .login file to only print out /etc/motd when its last mod time
changes.  Since no further advice regarding what .hushlogin should look
like was provided, I did a little hacking.

If I use a .hushlogin which looks like this:

.hushlogin:     /etc/motd
        cat /etc/motd
        touch .hushlogin

I get:
Make: No arguments or description file.  Stop.

I thought it might have something to do with the '.' in the
first column, so I tried:

hushlogin:      /etc/motd
        cat /etc/motd
        touch .hushlogin hushlogin

which works fine, but uses a 2nd file "hushlogin".

If I put a backslash in front of the '.' like so:

\.hushlogin:    /etc/motd
        cat /etc/motd
        touch .hushlogin

it always cat's and touch'es.

Are there any "make" aces out there that know what's going on here?

BTW, I noticed that if you have a .hushlogin, the "You have mail"
message is also suppressed when you login, so I put the "mail"
command into my .login.

Also, even if you use "make -s -f .hushlogin" to suppress the make
chatter, make will still print out "`.hushlogin' is up to date"
when you log in and /etc/motd hasn't been changed.

I think I'll switch to someone else's suggestion and try:

cmp -s .hushlogin /etc/motd
if ($status) then
        cat     /etc/motd | tee .hushlogin
endif

then I won't have to deal with make.

____________________________________________________
|Jim Marselle           | Phone: (313) 986-1413    |

|Computer Science Dept. |                          |
|30500 Mound Road       |                          |
|Warren, MI  48090-9057 |                          |
----------------------------------------------------

 
 
 

.hushlogin

Post by d.. » Thu, 03 May 1990 00:22:00



>If I use a .hushlogin which looks like this:

>.hushlogin: /etc/motd
>    cat /etc/motd
>    touch .hushlogin

>I get:
>Make: No arguments or description file.  Stop.

This is very obscure, but documented (I don't remember where, but I
found it when I was rewriting the make manual page at Tektronix).

The idea is that the "default target" is the first target in the file
that does not begin with a '.'. This is done so that you can do
things like

        .SUFFIXES: .c .s ...
        ...
        all: $(PGM)
        ...

and be able to say 'make' and mean 'make all'.

The easiest solution is to add the line

        all: .hushlogin

at the end of the file, so you end up with:

        .hushlogin:     /etc/motd


        all: .hushlogin


data.)

Still, all this is no better than

        find /etc/motd -newer .hushlogin -exec cat '{}' \;
        touch .hushlogin

If you really want to see /etc/motd when it changes, use the "cmp"
stuff.
--
David Elliott           {decvax,ucbvax,ihnp4}!decwrl!mips!dce

 
 
 

.hushlogin

Post by Rahul Dhe » Wed, 02 May 1990 02:14:00



>The other day I read someone's suggestion to use a "make -f .hushlogin"
>in the .login file to only print out /etc/motd when its last mod time
>changes.

[discussion of many variations of this, leading to:]

Quote:>I think I'll switch to someone else's suggestion and try [something else.]

Here is a solution I actually used for some years with 4.2BSD:

     find /etc -name motd -newer .hushlogin \
        -a -exec cat /etc/motd \; \
        -a -exec touch .hushlogin

On the face of it this could be ineffeicient.  But since /etc turns out
to have no subdirectories (under 4.2BSD) it's actually pretty fast.
Please check the syntax since I am quoting from memory.

The real solution is:

     GET RID OF THAT /ETC/MOTD!!!  Use a sensible one-time message
     utility like "msgs" (4.xBSD) or "news" (System V).
--
Rahul Dhesi         UUCP:  {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi

 
 
 

.hushlogin

Post by sbann.. » Wed, 02 May 1990 18:02:00



>If I use a .hushlogin which looks like this:

>.hushlogin: /etc/motd
>    cat /etc/motd
>    touch .hushlogin

>I get:
>Make: No arguments or description file.  Stop.
>I think I'll switch to someone else's suggestion and try:

>cmp -s .hushlogin /etc/motd
>if ($status) then
>    cat     /etc/motd | tee .hushlogin
>endif

This is the first thing in my .login, and I have a null .login.  I have
had no problems with it.  I only get the message when the file changes.

# Check for the message of the day.
find /etc/motd -newer ~/.hushlogin -exec cat /etc/motd \;
touch ~/.hushlogin

                      S. John Banner

...!uw-beaver!uvicctr!sol!sbanner1
...!ubc-vision!uvicctr!sol!sbanner1


 
 
 

.hushlogin

Post by Brandon Allbe » Wed, 02 May 1990 20:01:00



+---------------
| If I use a .hushlogin which looks like this:
|
| .hushlogin:   /etc/motd
|       cat /etc/motd
|       touch .hushlogin
|
| I get:
| Make: No arguments or description file.  Stop.
+---------------

A make rule starting with a period is a generic rule for converting a file
with some suffix to a file with another suffix (or a file with no suffix).
Thus, make sees a rule to convert xxx.hushlogin to xxx for any xxx, but no
other commands to actually do anything.  Backslashing the `.' makes it a
normal (i.e. specific) rule, so make has something to do.

+---------------
| Also, even if you use "make -s -f .hushlogin" to suppress the make
| chatter, make will still print out "`.hushlogin' is up to date"
| when you log in and /etc/motd hasn't been changed.
+---------------

A ``kluge'' I use to get around this is:

all: foo
foo: (dependencies and commands)

Actually, `all' may be any file you don't have.  Since there is no file `all'
and your rules don't create one, make is silent about its (non)existence.

++Brando
--
Brandon S. Allbery                 UUCP: cbatt!cwruecmp!ncoast!tdi2!brandon


Mentor, Ohio 44060                PHONE: +1 216 255 1080 (home +1 216 974 9210)

 
 
 

1. .hushlogin info needed <again>

I came across a way to suppress the motd by creating a file called
.hushlogin. There was even a way to have it only display the motd if it
had changed since the last time you logged in. I set everything up and it
worked as advertized, but...

I have a question (or a problem). When .hushlogin exists, it also
suppresses the biff notification that I have mail. Is there a way to still
get the mail notification? Can I force a biff notifiction from within my
.login or .cshrc?

 --
______________________________________________________________________________

        User of Geoworks Ensemble instead of M$ Windoze
        Try the demo at ftp://arginine.umdnj.edu/pub/geos/publish
                     or ftp://ftp.mcs.com/mcsnet.users/jbarr/GeoPublish    

2. HELP WANTED - COMPUTER SYSTEM TECHNICIAN

3. QUESTION: How do I check for new mail with .hushlogin?

4. how to force RS/6000 boot from CDROM?

5. What is a .hushlogin file

6. webcam setup

7. hushlogin: last login without motd

8. "uid" opt on Rockridge CD in isofs

9. HELP: reading new MOTD (.hushlogin present)

10. .hushlogin help over site

11. .hushlogin

12. ".hushlogin": where and when

13. What Is A .hushlogin