tcsh: How to disable printing motd w/o disabling mail check?

tcsh: How to disable printing motd w/o disabling mail check?

Post by Harald.Eik.. » Thu, 27 Aug 1992 21:09:39



! I have considered adding a .hushlogin, and a shell script or short
! program to check the status of my mailbox, but I'm not sure how to
! write one that will distinguish new mail from old.
!
! Any suggestions?

Not exacly your typical shell script, but...

I know I really should have included stat.pl (i.e. "require 'stat.pl'") in
order to use symbolic indexing with mstat, but regrettably our sys admin
haven't gotten around to h2pl conversion yet.

  ~~harald E.

========chkmail========
#!/local/bin/perl


if ( ! $mail || ! -r $mail ) {
    $user = (getpwuid($<))[0] if !($user = getlogin);

    if ( -r "/usr/spool/mail/$user" ) {
        $mail = "/usr/spool/mail/$user";
    } elsif ( -r "/usr/mail/$user" ) {
        $mail = "/usr/mail/$user";
    } else {
        exit 1;
    }

}




print "You have$new mail.\n";
exit 0;
=======================

 
 
 

tcsh: How to disable printing motd w/o disabling mail check?

Post by Rich Sa » Thu, 27 Aug 1992 23:34:56



Quote:>I'm using tcsh, and would like to disable the printing of /etc/motd
>at login, without getting rid of the "You have {new} mail" messages.

        cmp -s /etc/motd $HOME/.hushlogin
        if ( $status ) tee $HOME/.hushlogin </etc/motd

 
 
 

tcsh: How to disable printing motd w/o disabling mail check?

Post by William W. Arno » Fri, 28 Aug 1992 23:08:06



Quote:>I'm using tcsh, and would like to disable the printing of /etc/motd
>at login, without getting rid of the "You have {new} mail" messages.

if (`ls -t1 $mail $home/.hushlogin | head -1` == $mail) then
  echo '-----new mail-------'
  touch $home/.hushlogin
endif

--

 
 
 

1. Disable mail check in HP-UX

I understand that there is a fairly simple way to disable the automatic
mail check that users receive at login. I have an HP-UX system to work
with and would like to know if this setting exists, and if so, how one
goes about using it on a user by user basis. We use csh primarily for
accounts. (Please include my address in any post to this newsgroup)

Thanks in advance

                            -- Mike  Karlesky --
 =============================================================================
      Until you find something worth dying for, you're not really living.
 =============================================================================

2. NEW: KNOWLEDGE Database

3. disabling motd

4. Mandrake & keyboard

5. What to disable and how to disable

6. TCP/IP Help! "eth0: Mismatched Read Page Pointer 4c v 4d" ?????

7. MAIL: How to disable mail for a particular user ?

8. Virus Alert : "A Virtual Card for You" + "An Internet Flower For You"

9. Disable print banners when printing to remote BSD printer

10. tcsh/wyse50 question: CR disabled (!?)

11. how to disable echoing in tcsh ??

12. tcsh - how to disable beeping

13. disable suspend in tcsh source code