LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2008, 02:53 PM   #1
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Rep: Reputation: 15
Post Message on boot up


I would like to change all those random messages that's poping out everytime you login in Linux that says " you have mail " but I just can't figure out where does the system gets all these messages. Anyone knows?


Thanks
 
Old 12-08-2008, 03:15 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897
Quote:
Originally Posted by Allanitto Newbee View Post
I would like to change all those random messages that's poping out everytime you login in Linux that says " you have mail " but I just can't figure out where does the system gets all these messages. Anyone knows?
Thanks
Yes, and they're not 'random'. You get messages due to having mail on the system, either through receiving it (if you're running a mail server), or for job notifications, etc.

You don't say what version/distro of Linux you're using...but there are two ways to get rid of them. One is to read and delete the messages (type in "mail" at the prompt), the other is to look in /var/spool/mail (usually...), for a file with your name on it. Remove it.
 
Old 12-08-2008, 03:30 PM   #3
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
I'm running a Slackware 12. I'm not planning to delete it I just want to change it to read/display my own set of messages. Anyways, I'll try to check those files you just mentioned or run "mail" when I get home.


Thanks a lot for the hint. I'll let you guys know.
 
Old 12-08-2008, 03:58 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897
Quote:
Originally Posted by Allanitto Newbee View Post
I'm running a Slackware 12. I'm not planning to delete it I just want to change it to read/display my own set of messages. Anyways, I'll try to check those files you just mentioned or run "mail" when I get home.

Thanks a lot for the hint. I'll let you guys know.
Ahh...you want to change the message you get. Check your default profile, or your own profile (either .profile, .bash_profile, or .bashrc), to see which one checks for mail. That'll be the one that echos "You have new mail", or do whatever other check you want.

The default profile will affect everyone on your system....your own profile is just yours.
 
Old 12-08-2008, 08:55 PM   #5
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Hi TBone,

sorry about this stupid question hehe... in which directory will I find those file?

thanks in advance
 
Old 12-09-2008, 07:47 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
In your home directory, /home/username.
 
Old 12-09-2008, 08:42 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897
Quote:
Originally Posted by Allanitto Newbee View Post
Hi TBone,

sorry about this stupid question hehe... in which directory will I find those file?

thanks in advance
NP...and I should have mentioned it, sorry. The default profile (system-wide), is usually /etc/default/profile, or /etc/profile. User-related profiles are in the users home directory, usually /home/<whatever>
 
Old 12-12-2008, 08:04 PM   #8
Allanitto Newbee
Member
 
Registered: Oct 2007
Location: Montreal
Distribution: Slackware12;Slackware13
Posts: 106

Original Poster
Rep: Reputation: 15
Okay... I have found the script in /etc named profile but I don't know how to read it. To where does it point to read and display messages? what is the filename?

This is what is written:
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.

# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man
export HOSTNAME="`cat /etc/HOSTNAME`"
export LESSOPEN="|lesspipe.sh %s"
export LESS="-M"

# If the user doesn't have a .inputrc, use the one in /etc.
if [ ! -r "$HOME/.inputrc" ]; then
export INPUTRC=/etc/inputrc
fi

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH. Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
fi
fi

# I had problems with the backspace key using 'eval tset' instead of 'TERM=',
# but you might want to try it anyway instead of the section below it. I
# think with the right /etc/termcap it would work.
# eval `tset -sQ "$TERM"`

# Set TERM to linux for unknown type or unset variable:
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
TERM=linux
fi

# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
VISUAL=emacs
# VISUAL=gmacs
# VISUAL=vi
fi

# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
PS1='$ '
else
PS1='\u@\h:\w\$ '
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2

# Default umask. A umask of 022 prevents new files from being created group
# and world writable.
umask 022

# Notify user of incoming mail. This can be overridden in the user's
# local startup file (~/.bash.login or whatever, depending on the shell)
if [ -x /usr/bin/biff ]; then
biff y 2> /dev/null
fi

# Append any additional sh scripts found in /etc/profile.d/:
for profile_script in /etc/profile.d/*.sh ; do
if [ -x $profile_script ]; then
. $profile_script
fi
done
unset profile_script

# For non-root users, add the current directory to the search path:
if [ ! "`id -u`" = "0" ]; then
PATH="$PATH:."
fi


Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Gutsy: won't boot. error message after boot begins: "metapage_read_end_io: I/o brjoon1021 Linux - Newbie 1 04-01-2008 10:19 AM
no /boot/loader and no /boot/kernel/kernel error message on a free bsd install chownuseradd Linux - Newbie 1 02-09-2008 09:05 PM
boot message Aldebaran Linux - Newbie 3 05-09-2006 08:46 AM
Boot Message dudeman41465 Linux - General 3 05-03-2006 09:14 AM
li error and boot disk gives boot failure message Mr.Scum Linux - General 5 05-20-2003 11:41 AM


All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration