Subject: bin/34790: ksh(1) does not mention $HOME/.kshrc
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 10/12/2006 01:10:01
>Number:         34790
>Category:       bin
>Synopsis:       ksh(1) does not mention $HOME/.kshrc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 12 01:10:00 +0000 2006
>Originator:     Christian Biere
>Release:        NetBSD 4.99.3
>Environment:
System: NetBSD cyclonus 4.99.3 NetBSD 4.99.3 (STARSCREAM) #0: Mon Oct 2 23:04:22 CEST 2006 src@cyclonus:/o/NetBSD/obj/sys/arch/i386/compile/STARSCREAM i386
Architecture: i386
Machine: i386
>Description:
The manpage of /bin/ksh does not mention ~/.kshrc anywhere. It only talks
about DEFAULT_ENV which is actually a boiler plate text. The user should
not have to check the compiler (or trace the process) to know what file
this refers to.
>How-To-Repeat:
 $ ktruss ksh 2>&1 | grep open
 $ man ksh
>Fix:

As I don't expect DEFAULT_ENV to change, the following patch should be
sufficient.

--- bin/ksh/ksh.Man.orig	2006-10-12 02:38:08.000000000 +0200
+++ bin/ksh/ksh.Man	2006-10-12 02:39:47.000000000 +0200
@@ -125,14 +125,14 @@
 If the basename of the name the shell is called with (\fIi.e.\fP, argv[0])
 starts with \fB\-\fP or if the \fB\-l\fP option is used, the shell is assumed
 to be a login shell and the shell reads and executes the contents of
-\fB/etc/profile\fP and \fB$HOME/.profile\fP if they exist and are readable.
+\fB/etc/profile\fP, \fB$HOME/.profile\fP and \fB$ENV\fP if they exist and are
+readable.
 .PP
 If the \fBENV\fP parameter is set when the shell starts (or, in the
 case of login shells, after any profiles are processed), its value
 is subjected to parameter, command, arithmetic and tilde substitution and
 the resulting file (if any) is read and executed.
-If \fBENV\fP parameter is not set (and not null) and pdksh was compiled
-with the \fBDEFAULT_ENV\fP macro defined, the file named in that macro
+If the \fBENV\fP parameter is not set (and not null) the file \fB$HOME/.kshrc\fP 
 is included (after the above mentioned substitutions have been performed).
 .PP
 The exit status of the shell is 127 if the command file specified
@@ -3537,6 +3537,8 @@
 .\"}}}
 .\"{{{  Files
 .SH FILES
+~/.kshrc
+.br
 ~/.profile
 .br
 /etc/profile