[Top][All Lists]

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

--norc has no effect with -c

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

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I.
-I./include -I./lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux zybi.tlx 2.4.16 #2 Tue Nov 27 16:37:28 CET 2001 i686 unknown
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

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

You will see the output from .bashrc.

If the shell is invoked as sh, option --norc is on by default and works as expected.

Artur Zaprzala

reply via email to

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