Re: Mittels shell-Script Verzeichnis wechseln
Hallo Holger, wenn Du ein script mit sh,csh oder aehnlichem startest, wird ein Kindprozess gestartet, der den Elternprozess (Deine shell, in der Du das scipt aufrufst) nicht beeinflusst. Wenn Du 'source <script>' machst, ist auch nach Ausfuehren des scripts das working directory wo Du es haben willst (einschliesslich Umgebungsvariablen). Gruss, ulrich Ulrich Hiller Max-Planck-Institut fuer Astronomie Koenigstuhl 17 69117 Heidelberg Germany phone +49 6221 528238 fax +49 6221 528246 email hiller@mpia.de
Hallo,
ich möchte mittels eines shell-Scripts das Verzeichnis wechseln. Als das Script sieht z.B. so aus:
------------- #!/bin/sh
cd /home; pwd; ------------
Das Script wechselt zwar ins Verzeichnis /home, nur ist nach dem Ausführen wieder in dem Verzeichnis wo es aufgerufen wurde. Ich möchte aber nach Ende des Scripts im Verzeichnis /home sein. Wie mache ich das?
Danke, Holger
*** Ulrich Hiller (hiller@mpia-hd.mpg.de) schrieb heute in suse-linux:
[... TOFU ...]
Plase read http://learn.to/quote/ Danke. MfG Henning Hucke -- Einer muss den Frieden beginnen, wie den Krieg. -- Stefan Zweig
On Wednesday 25 February 2004 10:15, Ulrich Hiller wrote:
Hallo Holger, wenn Du ein script mit sh,csh oder aehnlichem startest, wird ein Kindprozess gestartet, der den Elternprozess (Deine shell, in der Du das scipt aufrufst) nicht beeinflusst. Wenn Du 'source <script>' machst, ist auch nach Ausfuehren des scripts das working directory wo Du es haben willst (einschliesslich Umgebungsvariablen). Gruss, ulrich
Danke, funktioniert. CIAO, Holger
participants (3)
-
Henning Hucke
-
Holger Macht
-
Ulrich Hiller