[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] 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.


Reply to: