On Mon, 05 Aug 2002 at 14:42 (+0200), Thomas Hertweck wrote: [...]
Aus dem Manual zu "bash":
Each command in a pipeline is executed as a separate process (i.e., in a subshell). [...] If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. [...] "(list)": list is executed in a subshell. [...] Command substitution and asynchronous commands are invoked in a subshell environment that is a duplicate of the shell environment, except that traps caught by the shell are reset to the values that the shell inherited from its parent at invocation. Builtin commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment.
Da stehts eigentlich, oder? :-)
Mist - man sollte sich selbst ab und zu eine Mail mit dem Inhalt *RTFM* schicken ;-) Also _ist_ es eine Subshell (gleiche Prozess-ID - siehe Bernds Mail deshalb, weil while ein Shell-Builtin ist), die aber die Umgebung der startenden Shell kopiert kriegt (also doch keine richtige Subshell?). Der Trick, wenn man eine Schleife braucht, ist also, wie Lars gezeigt hat, auf die Pipes zu verzichten und stattdessen stdin umzuleiten. Wieder was gelernt (und die Verwirrung etwas abgebaut). Jan