Typo in bash manual ("from ~/.bashrc and ~/.bashrc")

Bug #922023 reported by Victor Zamanian
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Gnu Bash
New
Undecided
Unassigned
bash (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

There must be a typo in the bash man page under INVOCATION:

"Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the remote shell daemon, usually rshd, or the secure shell daemon sshd. If bash determines it is being run in this fashion, it reads and executes commands from ~/.bashrc and ~/.bashrc, if these files exist and are readable. It will not do this if invoked as sh. The --norc option may be used to inhibit this behavior, and the --rcfile option may be used to force another file to be read, but rshd does not generally invoke the shell with those options or allow them to be specified."

To clarify:

"[...] reads and executes commands from ~/.bashrc and ~/.bashrc, if these files exist and are readable."

That can't be right. :-)

It is the second-to-last paragraph under the INVOCATION section (starts on line 188).

Not sure what it should say instead of that though.

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I see the manpage included in bash 4.2-1ubuntu1 in Ubuntu Precise mentions the same file name twice. It's also present in Ubuntu 11.10 at least.

Changed in bash (Ubuntu):
status: New → Confirmed
summary: - Typo in bash manual
+ Typo in bash manual ("from ~/.bashrc and ~/.bashrc")
tags: added: bitesize manpage oneiric precise string-fix
removed: bash manual typo
Revision history for this message
Daniel Polehn (dpolehn-gmail) wrote :

should this be ~/.bashrc and ~/.bash_profile? That's seems the most likely.

Changed in bash (Ubuntu):
assignee: nobody → Daniel Polehn (dpolehn-gmail)
Changed in bash (Ubuntu):
assignee: Daniel Polehn (dpolehn-gmail) → nobody
Revision history for this message
Benjamin Kerensa (bkerensa) wrote :

I'm not able to find the occurrence you refer to in the man page for bash from Ubuntu or even directly from Upstream so I'm going to ask for you to provide a screenshot or pastebin from terminal so we can confirm this because as of right now I do not believe this is a valid bug.

Changed in bash (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Victor Zamanian (victorz) wrote :

Well that's strange, considering Hans was able to see it. Are you sure you were looking in the right place?

"It is the second-to-last paragraph under the INVOCATION section (starts on line 188)."

Do note that "line 188" is dependent on your pager and terminal width. If you still are unable to find this, I am happy to provide a screenshot of the occurrence.

Revision history for this message
Benjamin Kerensa (bkerensa) wrote :

Well the strange thing is when I grabbed this source package the bash source was still inside a compressed file and the source tree only had the debian directory and that compressed source but I did expand it and grep -rl LINE_OF_TEXT * and was unable to find it I then open the man file with nano and did whereis to locate the string but still no luck.

Hmm I will investigate this more but if I can find the string in question I do plan to fix it but do we have a proposed adjustment?

Revision history for this message
Victor Zamanian (victorz) wrote :

I just grabbed the source for bash from http://ftp.gnu.org/gnu/bash/. (http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz)

Opening the doc/bash.1 file with man, I noticed that this is the state of that paragraph in that source package:

       "Bash attempts to determine when it is being run with its standard input
       connected to a network connection, as when executed by the remote shell
       daemon, usually rshd, or the secure shell daemon sshd. If bash deter‐
       mines it is being run in this fashion, it reads and executes commands
       from ~/.bashrc, if that file exists and is readable. It will not do
       this if invoked as sh. The --norc option may be used to inhibit this
       behavior, and the --rcfile option may be used to force another file to
       be read, but rshd does not generally invoke the shell with those
       options or allow them to be specified."

So it seems to me that the file name was simply duplicated and was only supposed to be mentioned once. So the solution is probably just to remove the duplication.

Revision history for this message
Benjamin Kerensa (bkerensa) wrote :

To better have a look at this can you please let me know which release of Ubuntu you are encountering this typo in?

Revision history for this message
Victor Zamanian (victorz) wrote :

Sure; I'm on oneiric.

Revision history for this message
Aditya V (kroq-gar78) wrote :

I can confirm this on Precise 12.04

Revision history for this message
Aditya V (kroq-gar78) wrote :

Victor,

It is strange indeed. I just downloaded the bzr tree from ubuntu:bash, extracted the tar, looked in doc/bash.1, and, strangely enough, it says:

"[...] determines it is being run in this fashion, it reads and executes
commands from \fI~/.bashrc\fP, if that file exists and is readable.
It will not do this if invoked as \fBsh\fP."

So it seems like the manpage in the deb isn't getting updated??? There's only one occurence of "~/.bashrc" in that paragraph even from the ubuntu branch. Wonder what's the problem...

Revision history for this message
Victor Zamanian (victorz) wrote :

The computers at the university I attend/work at have the same bug. They are running Debian 6.0.4. Some terminal output:

[12:18] salt:~$ lsb_release -dr
Description: Debian GNU/Linux 6.0.4 (squeeze)
Release: 6.0.4
Codename: squeeze
[12:18] salt:~$ apt-cache policy bash{,-doc}
bash:
  Installed: 4.1-3
  Candidate: 4.1-3
  Version table:
 *** 4.1-3 0
        500 http://ftp.se.debian.org/debian/ squeeze/main amd64 Packages
        500 file:/import/install60/ squeeze/main amd64 Packages
        100 /var/lib/dpkg/status
bash-doc:
  Installed: 4.1-3
  Candidate: 4.1-3
  Version table:
 *** 4.1-3 0
        500 http://ftp.se.debian.org/debian/ squeeze/main amd64 Packages
        500 file:/import/install60/ squeeze/main amd64 Packages
        100 /var/lib/dpkg/status
[12:18] salt:~$ man bash | tail -n+187 | head -11

       Bash attempts to determine when it is being run with its standard input
       connected to a a network connection, as if by the remote shell daemon,
       usually rshd, or the secure shell daemon sshd. If bash determines it
       is being run in this fashion, it reads and executes commands from
       ~/.bashrc and ~/.bashrc, if these files exist and are readable. It
       will not do this if invoked as sh. The --norc option may be used to
       inhibit this behavior, and the --rcfile option may be used to force
       another file to be read, but rshd does not generally invoke the shell
       with those options or allow them to be specified.

[12:18] salt:~$

Revision history for this message
Victor Zamanian (victorz) wrote :

I just downloaded the debian package from here: http://packages.ubuntu.com/precise/i386/bash/download

and the bash.1 file says the following on lines 421-423:

"determines it is being run in this fashion, it reads and executes
commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files
exist and are readable."

So maybe it's been fixed in the bzr trunk?

Revision history for this message
Nathan Williams (nathwill-deactivatedaccount-deactivatedaccount) wrote :

this is not found in the Debian Wheezy package, so i think it's been fixed upstream.

Changed in bash (Ubuntu):
status: Incomplete → In Progress
status: In Progress → Confirmed
Revision history for this message
Benjamin Kerensa (bkerensa) wrote :

Do you have a upstream bug # that we can attach?

Revision history for this message
Brian Murray (brian-murray) wrote :

The package bash was merged with Debian on July 12th and the fix for this bug seems to have been included in that merge.

http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/bash/quantal/view/head:/debian/patches/man-bashrc.diff#L32

Changed in bash (Ubuntu):
status: Confirmed → Fix Released
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers