bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem when running a function in profile.d


From: Dusan Juhas
Subject: problem when running a function in profile.d
Date: Fri, 21 Jun 2002 09:49:16 +0200 (CEST)

Hello,
I use this version of bash:
GNU bash, version 2.04.21(1)-release (i386-redhat-linux-gnu)
on RedHat Linux 7.1

I have this problem:
in /etc/profile.d is a file (login script -> mc.sh) which contains:
mc ()
{
        mkdir -p ~/.mc/tmp 2> /dev/null
        chmod 700 ~/.mc/tmp
        MC=~/.mc/tmp/mc-$$
        LC_COLLATE=c /usr/bin/mc -P "$@" > "$MC"
        cd "`cat $MC`"
        /bin/rm "$MC"
        unset MC;
}

When I log in as non-root user after reboot or invoking
su - <user>
everything is OK.
When I log in invoking
su <user>
this error appears:
bash: /etc/profile.d/mc.sh: line 1: syntax error near unexpected token `()'
bash: /etc/profile.d/mc.sh: line 1: `mc () '

The same error appears when I run: bash --debug

I tried to correct this by changing
mc ()
{...}
to
mc()
{...}
or
mc() {
...}

Is it a bug or do I something wrong?

-- 
Best regards,
Dusan Juhas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]