bug-bash
[Top][All Lists]
Advanced

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

Re: problem when running a function in profile.d


From: Chet Ramey
Subject: Re: problem when running a function in profile.d
Date: Mon, 24 Jun 2002 11:21:11 -0400

> 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

The usual cause for this problem is an alias named `mc'.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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