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

Re: Bash: pipe once more

"Stefan Schmidt" <Stefan.Schmidt@gmx.de> writes:


>if I pipe the output of a cd command the working directory doesn't change.

That's because all elements of a pipeline except the last are run in
different processes to the main shell that starts the pipeline. As such,
the cd command is running in a subshell which exits when cd exits. This
has no effect on your main shell, which will keep the original working

Reply to: