Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [subshell or not subshell?] Re: echo ${pwd::="$( pwd/Next)"} failed
- X-seq: zsh-users 11175
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: [subshell or not subshell?] Re: echo ${pwd::="$( pwd/Next)"} failed
- Date: Fri, 02 Feb 2007 07:40:32 -0800
- In-reply-to: <45C2F715.5050802@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <45C23EFE.5050002@xxxxxxxxxxxxxxxxxx> <20070201195024.GA80015@xxxxxxxxxxxxxxxx> <45C2D636.4020508@xxxxxxxxxxxxxxxxxx> <20070202065230.GA44511@xxxxxxxxxxxxxxxx> <45C2F715.5050802@xxxxxxxxxxxxxxxxxx>
On Feb 2, 9:32am, Marc Chantreux wrote:
}
} I found no way to execute it in the current shell (something like
} ${a::=${( pwd/Next)}} ).
You're correct: It's impossible to capture the standard output of a
command that is executing in the current shell, because the way unix
pipes work prevents the same process from talking to itself.
(It can be done with some effort, but it's hard to prevent it from
deadlocking because the same process can't simultaneously read and
write [unless it's multi-threaded, which shells aren't].)
The solution is to change pwd/Next to accept an argument which is the
name of a variable to which to assign the new password.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author