Bug 79371 - syntax error in /etc/profile.d/mc.sh
syntax error in /etc/profile.d/mc.sh
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-10 16:16 EST by Jack Tanner
Modified: 2015-01-07 19:02 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-23 01:35:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
output of "bash --login -x 2> /tmp/output" (9.26 KB, text/plain)
2002-12-11 20:06 EST, Jack Tanner
no flags Details

  None (edit)
Description Jack Tanner 2002-12-10 16:16:09 EST
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/mc.sh: line 1: syntax error near unexpected token `('
bash: /etc/profile.d/mc.sh: line 1: `mc ()'

% cat /etc/profile.d/mc.sh
mc ()
{
        mkdir -p $HOME/.mc/tmp 2> /dev/null
        chmod 700 $HOME/.mc/tmp
        MC=$HOME/.mc/tmp/mc-$$
        /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 18:00:02 EST
Can you run the command  "bash --login -x 2> /tmp/output"
and attach /tmp/output to this bug report, and reopen the bug?

Thanks
Comment 2 Jack Tanner 2002-12-11 20:06:52 EST
Created attachment 88492 [details]
output of "bash --login -x 2> /tmp/output"
Comment 3 Havoc Pennington 2002-12-11 21:26:19 EST
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 17:23:17 EST
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 01:35:14 EDT
bashrc re-runs all the profile.d stuff for constant initialization,
so, not a bug.

Note You need to log in before you can comment on or make changes to this bug.