Hallo zusammen,
ich versuche gerade zu verstehen, WARUM bei manschen Konstellationen es sinnvoll ist, Skripte mittels Kommando SOURCE auszuführen. Dazu habe ich ein bisschen gegoogelt und habe folgendes gefunden:
Execute Shell Script Using . ./ (dot space dot slash)
While executing the shell script using “dot space dot slash”, as shown below, it will execute the script in the current shell without forking a sub shell.
In other words, this executes the commands specified in the scriptfile in the current shell, and prepares the environment for you.
“dot space dot slash” Usage Example:
Typically we use this method, anytime we change something in the .bashrc or .bash_profile. i.e After changing the .bashrc or .bash_profile we can either logout and login for the changes to take place (or) use “dot space dot slash” to execute .bashrc or .bash_profile for the changes to take effect without logout and login.
Die Ausführung eines Skriptes mit Kommando SOURCE bewirkt also, dass für die Ausführung kein Kind-Shell erzeugt wird. So ist es sichergestellt, dass das Skript die möglicherweise notwendigen Umgebungsvariablen hat(da das Skript ja in der aktuellen Shell ausgeführt wird). Meine Frage:
Ist das denn nicht so, dass Umgebungsvariablen einer Shell sowieso weiter an die Kind-Shells weiter vererbt werden? Eine Kind-Shell bekommt die Umgebungsvariablen vo der Vater-Shell nicht?
Zu der Beispielanwendung:
Typically we use this method, anytime we change something in the .bashrc or .bash_profile. i.e After changing the .bashrc or .bash_profile we can either logout and login for the changes to take place (or) use “dot space dot slash” to execute .bashrc or .bash_profile for the changes to take effect without logout and login.
Warum sollte es nicht möglich sein, sich nach einer Änderung von .bashrc bzw. .bash-profile auszuloggen oder einzuloggen?
Vielen Dank für Eure Hilfe
Schöne Grüße aus Rheinland,
Eure Ratna
ich versuche gerade zu verstehen, WARUM bei manschen Konstellationen es sinnvoll ist, Skripte mittels Kommando SOURCE auszuführen. Dazu habe ich ein bisschen gegoogelt und habe folgendes gefunden:
Execute Shell Script Using . ./ (dot space dot slash)
While executing the shell script using “dot space dot slash”, as shown below, it will execute the script in the current shell without forking a sub shell.
Code:
$ . ./scriptfile
In other words, this executes the commands specified in the scriptfile in the current shell, and prepares the environment for you.
“dot space dot slash” Usage Example:
Typically we use this method, anytime we change something in the .bashrc or .bash_profile. i.e After changing the .bashrc or .bash_profile we can either logout and login for the changes to take place (or) use “dot space dot slash” to execute .bashrc or .bash_profile for the changes to take effect without logout and login.
Die Ausführung eines Skriptes mit Kommando SOURCE bewirkt also, dass für die Ausführung kein Kind-Shell erzeugt wird. So ist es sichergestellt, dass das Skript die möglicherweise notwendigen Umgebungsvariablen hat(da das Skript ja in der aktuellen Shell ausgeführt wird). Meine Frage:
Ist das denn nicht so, dass Umgebungsvariablen einer Shell sowieso weiter an die Kind-Shells weiter vererbt werden? Eine Kind-Shell bekommt die Umgebungsvariablen vo der Vater-Shell nicht?
Zu der Beispielanwendung:
Typically we use this method, anytime we change something in the .bashrc or .bash_profile. i.e After changing the .bashrc or .bash_profile we can either logout and login for the changes to take place (or) use “dot space dot slash” to execute .bashrc or .bash_profile for the changes to take effect without logout and login.
Warum sollte es nicht möglich sein, sich nach einer Änderung von .bashrc bzw. .bash-profile auszuloggen oder einzuloggen?
Vielen Dank für Eure Hilfe

Schöne Grüße aus Rheinland,
Eure Ratna