Verhindern, dass .bashrc ausgeführt wird, wenn eine neue Xterm-Instanz gestartet wird

662
irritable_phd_syndrom

Ich verwende CentOS 6.6 und gelegentlich, wenn ich ein neues Xterm-Fenster zeige, möchte ich nicht, dass die Xterm-Instanz .bashrc als Quelle verwendet. Gibt es eine Möglichkeit, dies zu tun?

-1
Was bestimmt, ob ".bashrc" ausgeführt werden soll oder nicht? Möchten Sie nur `.bashrc` oder` / etc / bash.bashrc` hemmen? Überprüfen Sie die Startoption `--bashrc`. AFH vor 8 Jahren 0

1 Antwort auf die Frage

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.