[Top][All Lists]

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

Re: --norc has no effect with -c

From: Artur Zaprzala
Subject: Re: --norc has no effect with -c
Date: Wed, 13 Feb 2002 16:33:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204

Chet Ramey wrote:

Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 21
Release Status: release

Option --norc has no effect when -c is used.

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

Probably because the ENV or BASH_ENV variable is set.

Another example. Put e.g. "echo foo" in your .bashrc and run:
bash -c echo --norc

You will see the output from .bashrc.

Probably because the ENV or BASH_ENV variable is set.

Yes, BASH_ENV is set. However, I think that --norc option should be stronger and make bash ignores ENV and BASH_ENV.

As Paul noted, my examples are wrong. This one is correct:
su me -- --norc /home/me/somescript

Artur Zaprzala

reply via email to

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