Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 79371

Summary: syntax error in /etc/profile.d/
Product: [Retired] Red Hat Linux Reporter: Jack Tanner <ihok>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: rvokal, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-23 05:35:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
output of "bash --login -x 2> /tmp/output" none

Description Jack Tanner 2002-12-10 21:16:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a)
Gecko/20021207 Phoenix/0.5

Description of problem:
Just installed Midnight Commander from the RedHat 8 (boxed) CD. When I start a
new shell, I get the following error.

bash: /etc/profile.d/ line 1: syntax error near unexpected token `('
bash: /etc/profile.d/ line 1: `mc ()'

% cat /etc/profile.d/
mc ()
        mkdir -p $HOME/.mc/tmp 2> /dev/null
        chmod 700 $HOME/.mc/tmp
        /usr/bin/mc -P "$@" > "$MC"
        cd "`cat $MC`"
        /bin/rm -f "$MC"
        unset MC;

% mc -V
GNU Midnight Commander 4.5.55
Edition: text mode
Virtual File System: tarfs, extfs, ftpfs, mcfs, undelfs
With builtin Editor
Using system-installed S-Lang library with termcap database
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
Using locale "C" (from environment variable LANG)

Steps to Reproduce:
1. Install mc from the RedHat 8 CD using redhat-config-package
2. % bash

Comment 1 Havoc Pennington 2002-12-10 23:00:02 UTC
Can you run the command  "bash --login -x 2> /tmp/output"
and attach /tmp/output to this bug report, and reopen the bug?


Comment 2 Jack Tanner 2002-12-12 01:06:52 UTC
Created attachment 88492 [details]
output of "bash --login -x 2> /tmp/output"

Comment 3 Havoc Pennington 2002-12-12 02:26:19 UTC
your .bashrc has alias 'mc=env LANG=C mc' 
which is causing the problem.

I'm not sure why /etc/bashrc reruns all the /etc/profile.d stuff, 
that results in running it both before and after your .bashrc.
I'll reassign to setup in case someone wants to look at that.

Comment 4 Jack Tanner 2002-12-14 22:23:17 UTC
Well, the reason I alias mc to 'env LANG=C mc' is because otherwise the UTF-8
encoding doesn't play nice with openssh 3.5p1, which I use to log in remotely,
and mc's window borders, etc., are completely screwed up.

Still, I use the same aliasing approach with man ('env LANG=C man') and info,
and neither of those gives me a syntax error when I run bash.

Is LANG=C a bad idea? How can I run mc over ssh, then?

Comment 5 Bill Nottingham 2004-09-23 05:35:14 UTC
bashrc re-runs all the profile.d stuff for constant initialization,
so, not a bug.