Am Donnerstag, 19. August 2004 00:26 schrieb Ulrich Gerner:
Hallo Zusammen,
trotz googeln bleibe ich ohne Erfolg:
Wo stelle ich in einer Suse 9.1 die PATH-Variablen ein?
Ich möchte Root (und nur Root) die Pfadangabe /usr/local/sbin dazufügen. Aber /etc/profile wirkt sich auf alle User aus, ich möchte explizit Root den Pfad erweitern.
Naja, da bietet sich doch ~/.profile an, so wie es für jeden anderen User auch gilt. Oder aber auch ~/.bash_profile, ~/.bashrc - aber ich denke ~/.profile ist besser da diese auch AFAIK von anderen shells gelesen wird. :) Ich kopier mir immer die /etc/profile nach ~/.profile und mach dann dort meine Anpassungen. Die /etc/profile ist für Systemweite Einstellungen gedacht. --- schnipp --- When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behav- ior. When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists. When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc. --- schnipp --- Für weiterführende Informationen hilft Dir: 'man bash' ;-)
Bei meinem user-account finde ich eine Pfadangabe für java und kann diese nirgends finden...
Auch in diesem Fall - schau mal nach in ~/.profile bzw. ~/.bashrc
Welche Dateien sind für Root, welche für den User bezüglich der PATH-Variable zuständig?
s.o.
Und übrigends, wo stellt man den sinnvollerweise eigene Scripts hin, die nur Root ausführen sollte (/usr/local/sbin oder /usr/local/bin)?
Nein! /root/bin und dieses Verzeichnis trage ich dann auch für root in den Pfad ein. HTH, Andreas.