Запретить запуск .bashrc при запуске нового экземпляра xterm

583
irritable_phd_syndrom

Я использую CentOS 6.6, и иногда, когда я создаю новое окно xterm, я не хочу, чтобы экземпляр xterm получал исходный код .bashrc. Есть ли способ сделать это?

-1
Что определяет, хотите ли вы запустить `.bashrc` или нет? Вы хотите запретить только `.bashrc` или также` / etc / bash.bashrc`? Проверьте опцию запуска --bashrc. AFH 8 лет назад 0

1 ответ на вопрос

0
Toby Speight

Your .bashrc is not read by xterm; it is read by the bash that xterm runs if you don't supply a command with -e. You can tell Bash not to read /etc/bash.bashrc and ~/.bashrc by giving it the --norc option:

xterm -e bash --norc 

You may, of course, want to source /etc/bash.bashrc but not ~/.bashrc; I suggest you simply do that from within your new shell:

. /etc/bash.bashrc 

but you may instead tell Bash to use that as your one and only initialization file:

xterm -e bash --rcfile /etc/bash.bashrc 

Full details of those Bash options are of course in the man page.

Похожие вопросы