bug-bash
[Top][All Lists]
Advanced

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

Re: --norc has no effect with -c


From: Paul Jarc
Subject: Re: --norc has no effect with -c
Date: Wed, 13 Feb 2002 09:58:53 -0500
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu)

Artur Zaprzala <artur.zaprzala@talex.com.pl> wrote:
> When I run as root the following command (change "me" to existing user):
> su -c echo me -- --norc
> I get the message:
> bash: /root/.bashrc: Permission denied
>  This shows that bash tries to read ~/.bashrc inspite of --norc option

The "--norc" argument is not recognized as an option because is
appears after the "-c" script.  See the bash man page, near the top
under "OPTIONS":
       -c string If  the  -c option is present, then commands are
                 read from string.  If there are arguments  after
                 the  string, they are assigned to the positional
                 parameters, starting with $0.

$ bash -c 'echo ":$-:"; echo ":$0:"' -e
:hBc:
:-e:
$ bash -e -c 'echo ":$-:"; echo ":$0:"'
:ehBc:
:bash:


paul



reply via email to

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