Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   How to add fortune output to terminal (http://www.linux-archive.org/debian-user/68102-how-add-fortune-output-terminal.html)

Angus Auld 04-11-2008 12:02 PM

How to add fortune output to terminal
 
Greetings,
Would someone be able to advise me as to what is a
safe method to add a fortune command to my .bashrc
file so as to have fortune output in my terminal @
login?
I've googled this pretty extensively, and have found a
few methods, but also warnings that certain processes
can be broken by doing this.
Any insights would be appreciated.
TIA. Best regards.

--
AA

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Paul Cartwright 04-11-2008 12:32 PM

How to add fortune output to terminal
 
On Fri April 11 2008, Angus Auld wrote:
> Would someone be able to advise me as to what is a
> safe method to add a fortune command to my .bashrc
> file so as to have fortune output in my terminal @
> login?
add these lines to your ~/.bashrc
echo
echo "fortune"
echo
fortune -a
echo


--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Angus Auld 04-11-2008 12:50 PM

How to add fortune output to terminal
 
--- Angus Auld <aonghas_auld@yahoo.com> wrote:

> Greetings,
> Would someone be able to advise me as to what is a
> safe method to add a fortune command to my .bashrc
> file so as to have fortune output in my terminal @
> login?
> I've googled this pretty extensively, and have found
> a
> few methods, but also warnings that certain
> processes
> can be broken by doing this.
> Any insights would be appreciated.
> TIA. Best regards.
>
> --
> AA
Thank you for the replies...much appreciated indeed.
Best regards.

--
AA

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Owen Townend" 04-11-2008 01:37 PM

How to add fortune output to terminal
 
> Greetings,
> Would someone be able to advise me as to what is a
> safe method to add a fortune command to my .bashrc
> file so as to have fortune output in my terminal @
> login?
> I've googled this pretty extensively, and have found

> a
> few methods, but also warnings that certain
> processes
> can be broken by doing this.
> Any insights would be appreciated.
> TIA. Best regards.
>

Hey,
**An extract from my .bashrc

if [ -x /usr/games/fortune ]; then
**echo; /usr/games/fortune -a; echo
fi

**Also, IIRC, the default 'fortunes-mod' package includes only a single data file which has no 'offensive' fortunes, so unless you add more (e.g. fortunes-off) the '-a' is unnecessary.


cheers,
Owen.

"s. keeling" 04-12-2008 01:00 AM

How to add fortune output to terminal
 
Owen Townend <owen.townend@gmail.com>:
>
> An extract from my .bashrc
>
> if [ -x /usr/games/fortune ]; then
> echo; /usr/games/fortune -a; echo
> fi
>
> Also, IIRC, the default 'fortunes-mod' package includes only a single data
> file which has no 'offensive' fortunes, so unless you add more (e.g.
> fortunes-off) the '-a' is unnecessary.

And for real technicolor stuff, hunt for the kernelnewbies fortunes
file; selected quotes from lkml:

-----------------------------
"I want you guys to look at your computer screen, imagining the worst
monster you can (the cacodeamon from Quake will do, just make him hairier
and bigger and more MEAN), and think of me. Think of me like I am when I
see a patch which isn't a pure bug-fix.

If you're whimpering just _thinking_ about sending me a new feature,
you're in the right mindframe. Keep that mindframe."

- Linus Torvalds
-----------------------------

What a freaking tyrant! :-O How the heck did
$any_feature_you_care_to_name survive development?!? This from the
guy who was once wondering why his newborn might need a tcp/ip stack?


[just kidding, L.]
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Owen Townend" 04-12-2008 01:46 AM

How to add fortune output to terminal
 
And for real technicolor stuff, hunt for the kernelnewbies fortunes
file; selected quotes from lkml:

******-----------------------------
"I want you guys to look at your computer screen, imagining the worst

**monster you can (the cacodeamon from Quake will do, just make him hairier
**and bigger and more MEAN), and think of me. Think of me like I am when I
**see a patch which isn't a pure bug-fix.

**If you're whimpering just _thinking_ about sending me a new feature,

**you're in the right mindframe. Keep that mindframe."

********- Linus Torvalds
******-----------------------------

What a freaking tyrant!**:-O**How the heck did
$any_feature_you_care_to_name survive development?!?**This from the

guy who was once wondering why his newborn might need a tcp/ip stack?
Hey,
**Tyrant maybe, but I can see his point. I'm sure he'd have been more aminable to you sending in two patches, one for the bugfix and another for a feature. That way he can apply the bugfix and then, if he feels like it, look at the feature. It's similar*to*the bad form of refactoring and changing functionality in the same patch.


cheers,
Owen.


[just kidding, L.]

--
Any technology distinguishable from magic is insufficiently advanced.
(*)****http://blinkynet.net/comp/uip5.html******Linux Counter #80292

- -****http://www.faqs.org/rfcs/rfc1855.html****Please, don't Cc: me.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org

with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

04-13-2008 06:27 AM

How to add fortune output to terminal
 
Angus Auld wrote:
> Would someone be able to advise me as to what is a
> safe method to add a fortune command to my .bashrc
> file so as to have fortune output in my terminal @
> login?
> I've googled this pretty extensively, and have found a
> few methods, but also warnings that certain processes
> can be broken by doing this.

Your .bashrc should be completely silent. If it produces any output
then it will break 'scp' and 'rsync' at the least. Probably other
tools that use a remote shell such as cvs, git, etc.

http://www.openssh.org/faq.html#2.9

Bob

Andrei Popescu 04-14-2008 06:06 AM

How to add fortune output to terminal
 
On Sun, Apr 13, 2008 at 12:27:15AM -0600, Bob Proulx wrote:
> Angus Auld wrote:
> > Would someone be able to advise me as to what is a
> > safe method to add a fortune command to my .bashrc
> > file so as to have fortune output in my terminal @
> > login?
> > I've googled this pretty extensively, and have found a
> > few methods, but also warnings that certain processes
> > can be broken by doing this.
>
> Your .bashrc should be completely silent. If it produces any output
> then it will break 'scp' and 'rsync' at the least. Probably other
> tools that use a remote shell such as cvs, git, etc.
>
> http://www.openssh.org/faq.html#2.9

"[...] for non-interactive sessions."

amp@think:~$ tail -7 .bashrc

echo
echo "Fortune cookie:"
echo
fortune -a
echo

amp@think:~$ ssh localhost /bin/true
amp@think:~$


Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)

"Vikki Roemer" 04-14-2008 09:44 PM

How to add fortune output to terminal
 
On Sun, Apr 13, 2008 at 2:27 AM, Bob Proulx <bob@proulx.com> wrote:
> Angus Auld wrote:
> > Would someone be able to advise me as to what is a
> > safe method to add a fortune command to my .bashrc
> > file so as to have fortune output in my terminal @
> > login?
> > I've googled this pretty extensively, and have found a
> > few methods, but also warnings that certain processes
> > can be broken by doing this.
>
> Your .bashrc should be completely silent. If it produces any output
> then it will break 'scp' and 'rsync' at the least. Probably other
> tools that use a remote shell such as cvs, git, etc.
>
> http://www.openssh.org/faq.html#2.9

In my experience, I've never had fortune break scp, but maybe I've
just been lucky.

But, if it does cause problems, just remove it and add it to
.bash_profile instead.

--
Vikki Roemer

Registered Linux user #280021

"Sometimes the lights all shinin' on me;
Other times I can barely see.
Lately it occurs to me what a long, strange trip its been."
-- Grateful Dead, "Truckin'"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"s. keeling" 04-15-2008 12:08 AM

How to add fortune output to terminal
 
Vikki Roemer <vikki.roemer@gmail.com>:
> On Sun, Apr 13, 2008 at 2:27 AM, Bob Proulx <bob@proulx.com> wrote:
> > Angus Auld wrote:
> > > Would someone be able to advise me as to what is a
> > > safe method to add a fortune command to my .bashrc
> > > file so as to have fortune output in my terminal @
> > > login?
> > > I've googled this pretty extensively, and have found a
> > > few methods, but also warnings that certain processes
> > > can be broken by doing this.
> >
> > Your .bashrc should be completely silent. If it produces any output
> > then it will break 'scp' and 'rsync' at the least. Probably other
> > tools that use a remote shell such as cvs, git, etc.
> >
> > http://www.openssh.org/faq.html#2.9
>
> In my experience, I've never had fortune break scp, but maybe I've
> just been lucky.
>
> But, if it does cause problems, just remove it and add it to
> .bash_profile instead.

.bash_profile is for setting up global env vars. .bashrc is for doing
things for interactive ("login") sessions. Batch jobs are not login
sessions. xterm -ls is a login shell (runs your startup scripts).

Cf. "su" vs. "su -". The former gives user root privs with user's
env. The latter runs root's startup scripts and clobbers the
user's process environment (in that child proc).


--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 01:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.