Red Hat Bugzilla – Bug 79371
syntax error in /etc/profile.d/mc.sh
Last modified: 2015-01-07 19:02:08 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a)
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/mc.sh: line 1: syntax error near unexpected token `('
bash: /etc/profile.d/mc.sh: line 1: `mc ()'
% cat /etc/profile.d/mc.sh
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"
% 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
Can you run the command "bash --login -x 2> /tmp/output"
and attach /tmp/output to this bug report, and reopen the bug?
Created attachment 88492 [details]
output of "bash --login -x 2> /tmp/output"
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.
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?
bashrc re-runs all the profile.d stuff for constant initialization,
so, not a bug.