Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 76200

Summary: /etc/skel/.bashrc inaccuracy
Product: Gentoo Linux Reporter: Matthew Walster <matthew>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Matthew Walster 2004-12-30 19:55:30 UTC
/etc/skel/.bashrc states that:

# 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.

It is also sourced by some non-interactive shells, and CAN generate output, although it is advised not to do so. Will not break the scp command - not checked rcp. Ciaran McCreesh (Gentoo Dev) verified this fact.

Reproducible: Always
Steps to Reproduce:
1. cat /etc/skel/.bashrc

Actual Results:  
Showed the file...

Expected Results:  
Change default to:

# This file is sourced by bash in most normal login situations. This file
# *should not generate any output* however, little will break if you do.

I'm a student. Oh how Christmas holidays bore me so... Happy New 2005 Gentoo 
Devs!
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2005-01-12 09:04:41 UTC
The comment is not perfect, but pretty close.  If you generate output from .bashrc, you should do it after a test for interactivity (by checking for PS1 or "i" in $- as explained in the bash man-page)

Currently in portage, the comment is:

# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output.

This isn't perfect since some versions of scp can tolerate output, but it's close enough, IMHO.  I believe there are older versions of scp that will break if .bashrc generates output without a prior test for interactivity.
Comment 2 SpanKY gentoo-dev 2005-01-12 15:12:37 UTC
i have broken my scp's in the past because my .bash files would run `screen -list` without checking to see if $TERM was "dumb" or not

scp would fail w/out error and/or any output, was quite annoying to track that bug down :)