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

Re: less with subprocess



in this command:

LF () { () { cat >$1 &! less $1 ; kill $! } =(:) }

what is the purpose of =(:)? It is a process substitution which executes the noop command, but why? 

Pier Paolo Grassi


Il giorno mer 29 set 2021 alle ore 15:03 Vincent Lefevre <vincent@xxxxxxxxxx> ha scritto:
On 2021-09-28 12:29:31 -0700, Bart Schaefer wrote:
> > Both do not work for me (zsh-5.7.1, less 487).  The generating
> > command is killed when ctrl-c is pressed for the first time
>
> There have been a few changes to subprocess signal handling since
> 5.7.1.  Most likely involved here is workers/49029.

Even with zsh 5.8, this doesn't work.

I get the following error:

cventin% LF () { () { cat >$1 &! less $1 ; kill $! } =(:) }
cventin% echo | LF
(anon):kill: kill 27684 failed: no such process

And

cventin% (sleep 1; echo foo) | LF

gives an empty file in "less", also with an error if I quit "less"
after 1 second.

--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author