Bug 24205 - --norc option does not work for bash invoked as bash.
Summary: --norc option does not work for bash invoked as bash.
Status: CLOSED NOTABUG
Alias: None
Product: Sisyphus
Classification: Development
Component: bash (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-03 00:34 MSD by viy
Modified: 2010-10-06 11:53 MSD (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description viy 2010-10-03 00:34:29 MSD
bash always read ~/.bashrc even when invoked with --norc option
bash-3.2.51-alt1 (sisyphus/x86_64). The same is true for 5.1 bash-3.2.48-alt3.
due to this bug I can't get rid of bashisms in my scripts.
$ sh -v -c 'echo hi'
echo hi
hi

$ bash --norc --noprofile -v -c 'echo hi'
# .bashrc
# User specific aliases and functions
[ ......................................]
echo hi
hi
Comment 1 Sergey Borovikov 2010-10-06 11:53:20 MSD
Читаем 'man bash':
>   --norc
>          Не читает и не выполняет персональный файл инициализации
>          ~/.bashrc, если командный интерпретатор работает интерактивно. Эта опция
>          по умолчанию включена, если интерпретатор вызван как sh.
Пробуем:
> $ bash --norc --noprofile -v
> bash-3.2$
либо
> $ bash --noprofile -v
> # .bashrc
> # User specific aliases and functions
> [ ......................................]
> bash-3.2$
Всё ок.
При запуске с ключом '-c ...' это не интерактивный режим.