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

Re: make importiert nicht shell-Umgebungsvariablen



Peter.Weiss@ConSol.de schrieb:


> Ein erster Anlauf wäre dazu die Manpage der verwendeten Shell ;-)

Da war ich schon...hat mich leider auch nicht weiter gebracht, s.u.
> 
> Kurz: Unix-Shells kennen in der Regel zwei Typen von Variablen: Die für
> export markierten und die ohne. Nur erstere werden an weitere Subprozesse
> vererbt.
> 
> Für die Variablen beim Start und die durchlaufenen rc-Files angeht ist der
> Abschnitt "INVOCATION" zuständig.

Okay, hier liegt ja gerade mein Verständnis-Problem, also bash(1) sagt dazu:

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
[...]

und

When  an  interactive  shell  that  is  not  a  login  shell  is  started, bash reads and
executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist.
[...]

Das Verwunderliche für mich ist nun, dass in all diesen besagten Dateien
die gesuchten Variablen OSTYPE, HOSTNAME, HOSTTYPE und wie sie alle heißen, eben NICHT
definiert sind. Ein grep -R <verfluchte Shell-Variable> ./ liefert mir nix.
Meine Config-Files sind praktisch nackt :-) zumindestens steht sehr wenig drin.
Die einzigen nichtkommentieren Zeilen in /etc/bash.bashrc sind:

shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below) <--ich weiß,
ist doch nen Kommentar :-) )

if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

Das war's. Ähnlich leer sieht es auch in den anderen Config-Files aus.
Wie sehen bei dir denn die entsprechenden Dateien aus? Findest du eine Datei, wo
OSTYPE=linux-gnu
o.ä. steht? Irgendwo müssen ja schließlich die Variablen herkommen...

Viele Grüße,
Andre



Reply to: