Bug 79371 - syntax error in /etc/profile.d/mc.sh
Summary: syntax error in /etc/profile.d/mc.sh
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: setup
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-10 21:16 UTC by Jack Tanner
Modified: 2015-01-08 00:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-23 05:35:14 UTC
Embargoed:


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

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/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 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?

Thanks

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.


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