Bug 6992

Summary: /etc/profile.d/00functions.sh causes problems for ksh users
Product: [Retired] Red Hat Linux Reporter: David W. Tamkin <dattier>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-12-17 22:31:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description David W. Tamkin 1999-11-13 21:20:01 UTC
Functions definitions in /etc/profile.d/00functions.sh use this syntax:

 function name () {
  commands
  }

Users who select /bin/ksh as their login shell (which is actually pdksh)
get an error, the function remains undefined, and later calls to that
function come up "not found," because in pdksh function definitions have
one of these two syntaxes (one to get the behavior of AT&T ksh, one to
get that specified under POSIX):

 function name {
  commands
  }

or

 name() {
  commands
  }

It's not permitted to use both the word "function" and the empty paren-
theses.

Meanwhile, /etc/profile.d/mc.sh defines a function with only the empty
parentheses, omitting the word "function," and it's fine under both bash
and pdksh.  The bash man page implies that the word "function" is totally
optional; if it were omitted in /etc/profile.d/00functions.sh, there would
be no harm under bash and much gained for ksh users.

[Hope I'm filing this report properly.]

Comment 1 Bill Nottingham 1999-11-15 16:51:59 UTC
I can't find an /etc/profile.d/00functions.sh anywhere in our
distribution. What does rpm -qf /etc/profile.d/00functions.sh say?