Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [subshell or not subshell?] Re: echo ${pwd::="$( pwd/Next)"} failed



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