LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No login phrase is coming now.. (https://www.linuxquestions.org/questions/linux-newbie-8/no-login-phrase-is-coming-now-656631/)

the.reverser 07-18-2008 10:03 AM

No login phrase is coming now..
 
Hi All,
In my early installation, whenever I was logging, System was telling me some good quote and phrase on the console screen only...
I don't know how I enabled that..
So when i did my this installation was looking for this option but all over but that didn't come.
Can anybody tell me how can I enable it..
Hey Friends,
I am sorry, I didn't mention that I am using the slackware 12.0.
can you please guide me now.
Thanks.

pruneau 07-18-2008 11:25 AM

Large set of options...
 
Without knowing precisely which distribution/version you were using, it's hard to determine how to do this, because they are quite a lot of options.

But usually, this either is done by the "login" program, or the shell you are using to work at the command line.

For example, login usually display the content of /etc/motd file, which could be updated regularly by a scheduled job.
Or you login shell could be doing this in its initialization (or .xxxxrc) file.

Usually, the provider of those funny quips is "fortune": make sure it is installed on you system, by invoking it at the command-line. It usually comes with a default fortune-cookies database that you can expand by installing more packages.

Provided that:
- you have fortune installed
- your login shell is bash (check by logging in and doing "echo $SHELL")
You can invoke it into your shell initialization script by adding those lines at the beginning of your ~/.bashrc
Code:

## The if below test:
# - wether we have a terminal attached and
# - whether this is a login shell
# because automatic process are usually not interested in fortune
# cookies: they might even cause bugs.
if [ -t 0 && "$SHLVL" == "1"]; then
    fortune
fi

Make sure to keep a copy of your old .bashrc, in case you make a mistake modifying it ;-)


All times are GMT -5. The time now is 02:39 AM.