View previous topic :: View next topic |
Author |
Message |
fubard n00b

Joined: 11 Jun 2004 Posts: 52
|
Posted: Wed Jul 07, 2004 3:34 pm Post subject: fortune display in console or terminal |
|
|
hi people, im sure a few of us have used slackware and remember how the a fortune or quote was always displayed once u login, does anybody know how to do this? im sure the pkg is called fortune... but how do i set it to display once i login to my box? _________________ if you spend enough time on it, eventually it all makes sense. |
|
Back to top |
|
 |
Dolio l33t


Joined: 17 Jun 2002 Posts: 650
|
Posted: Wed Jul 07, 2004 3:37 pm Post subject: |
|
|
I think the easiest way would be to put it in your .bashrc or .bash_profile. If you do that, it will print a fortune whenever you log into a console (regular console or xterm). _________________ They don't have a good bathroom to do coke in. |
|
Back to top |
|
 |
Celtis l33t


Joined: 05 Jul 2003 Posts: 737
|
Posted: Wed Jul 07, 2004 3:39 pm Post subject: |
|
|
The package you're looking for is called forune-mod. If you do an emerge -s fortune you can see all the categories of quotes that are available (Futurama is a must).
After you've installed it try: Code: | echo "fortune" >> ~/.bash_profile | to have a fortune quote appear whenever you login or open a new terminal.
EDIT: Changed .bashrc to .bash_profile as mentioned by trott
Last edited by Celtis on Fri Jul 09, 2004 8:36 am; edited 1 time in total |
|
Back to top |
|
 |
fubard n00b

Joined: 11 Jun 2004 Posts: 52
|
Posted: Wed Jul 07, 2004 3:43 pm Post subject: |
|
|
thanks  _________________ if you spend enough time on it, eventually it all makes sense. |
|
Back to top |
|
 |
trott n00b

Joined: 09 Jul 2004 Posts: 2
|
Posted: Fri Jul 09, 2004 8:17 am Post subject: |
|
|
True enough, but when you add it to your .bashrc, you can no longer use scp to copy files between the machines. Although you do get a remote fortune everytime you try to transfer something
so what would be the correct place to add the fortune command to? |
|
Back to top |
|
 |
Celtis l33t


Joined: 05 Jul 2003 Posts: 737
|
Posted: Fri Jul 09, 2004 8:33 am Post subject: |
|
|
EDIT: Nevermind, I see you've fixed it 
Last edited by Celtis on Fri Jul 09, 2004 8:35 am; edited 1 time in total |
|
Back to top |
|
 |
trott n00b

Joined: 09 Jul 2004 Posts: 2
|
Posted: Fri Jul 09, 2004 8:33 am Post subject: |
|
|
'use the search'
Quote: |
/etc/skel/.bashrc wrote:
# This file is sourced by all *interactive* bash shells on startup. This
# file *should generate no output* or it will break the scp and rcp commands.
|
If you want output when you login you should add the fortune command to ~/.bash_profile otherwise scp won't work. |
|
Back to top |
|
 |
gnuageux Veteran


Joined: 17 Apr 2004 Posts: 1201
|
Posted: Fri Jul 09, 2004 12:16 pm Post subject: |
|
|
Yeah, I wouldnt add it to .bash_profile (or rc) have you tried creating ~/.hush_login? _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
 |
Ignignokt n00b


Joined: 08 Jan 2003 Posts: 59
|
Posted: Fri Jul 09, 2004 2:22 pm Post subject: |
|
|
I added the fortune command in /etc/profile to make it system-wide. |
|
Back to top |
|
 |
SerfurJ l33t

Joined: 10 Apr 2004 Posts: 824 Location: Texas
|
Posted: Mon Nov 15, 2004 9:02 pm Post subject: |
|
|
thanks, i was looking for how to do this. i put it in /etc/profile also. |
|
Back to top |
|
 |
wjholden l33t

Joined: 01 Mar 2004 Posts: 826 Location: Augusta, GA
|
Posted: Fri Apr 01, 2005 10:14 pm Post subject: |
|
|
Code: | fortune homer | cowsay | Put that in /etc/profile, heh heh! |
|
Back to top |
|
 |
cweilema n00b

Joined: 15 May 2004 Posts: 38
|
Posted: Fri Mar 31, 2006 4:44 pm Post subject: |
|
|
I've tried adding:
Code: | echo
fortune -a
echo |
to both my ~/.bash_profile and /etc/profile with no success. The only way I've been able to have /etc/profile work is by doing:
Code: | source /etc/profile |
in my ~/.bashrc file, but that broke scp.
Does anyone have any suggestions for what I might be doing wrong? I use xterm and I really enjoy fortunes showing up when I fire up a terminal. On a side note, I do have the above fortune code in the root portion of my /etc/profile and whenever I "su -" in xterm, a fortune will pop up.
I'm really confused. Any help would be appreciated.
TIA,
--
-Chris |
|
Back to top |
|
 |
overkll Veteran

Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Fri Mar 31, 2006 5:35 pm Post subject: |
|
|
I copied this info from a slackware install a couple of years ago when moving from slackware to Gentoo. I added it to the end of my .bashrc files.
Code: | # Print a fortune cookie for interactive shells:
if [[ $- = *i* ]]; then
echo
fortune -s
echo
fi |
scp still works fine. |
|
Back to top |
|
 |
chunderbunny Veteran


Joined: 31 May 2004 Posts: 1281 Location: 51°24'27" N, 0°57'15" W
|
Posted: Fri Mar 31, 2006 9:18 pm Post subject: |
|
|
I have this in .bashrc (no idea where it came from). If you put it in as the first command then you can do whatever you like in .bashrc and not worry about breaking non-interactive stuff.
Code: | # If not running interactively, don't do anything
[ -z "$PS1" ] && return |
|
|
Back to top |
|
 |
|