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

Re: less with subprocess



On Mon, Sep 27, 2021 at 05:53:33PM -0700, Bart Schaefer wrote:
> On Mon, Sep 27, 2021 at 5:41 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > alias -g LF='| () { cat >$1 &! less $1 ; kill $! } =(:)'
>
> On additional thought ... it's not really saving very much to make
> this a global alias.  An actual function
>
> LF () { () { cat >$1 &! less $1 ; kill $! } =(:) }
>
> is only two more characters to pipe into, and can also be redirected into.

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:

  # using the alias
  { sleep 10; i=1; while true; do echo $i; i=$[i+1]; sleep 1; done } LF

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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