Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: less with subprocess
- X-seq: zsh-users 27196
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: less with subprocess
- Date: Fri, 1 Oct 2021 01:31:46 +0100
- Archived-at: <https://zsh.org/users/27196>
- In-reply-to: <CAP+y1xCSWkappkaRoM7+k=svEf3E_OKb_8o7mgGmkVMgPLX=Kg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Zsh-Users List <zsh-users@xxxxxxx>
- References: <CAH+w=7ZVWU444iL0u_RLfa-ormZTos+7M8iUQo-QqowqioFzCg@mail.gmail.com> <20210928185230.GA7495@gmx.de> <CAH+w=7ZgPGYngBrDEwcGqjrJ8GuLZ0Pn6VO9jDjvWz=_MPTzrw@mail.gmail.com> <20210929130217.GB25513@cventin.lip.ens-lyon.fr> <CAH+w=7an7ATJ51o-67ztFX+ShfEbrf158+Xi7OPtrm0X82vSbg@mail.gmail.com> <20210930191706.GA1641202@zira.vinc17.org> <20210930194800.GA15560@gmx.de> <CAP+y1xCVePc=3zKJeAuY0Z2Q0dO+42D78Jm6DN8dB4cpbnqgSA@mail.gmail.com> <20210930234612.GA21179@gmx.de> <CAP+y1xCSWkappkaRoM7+k=svEf3E_OKb_8o7mgGmkVMgPLX=Kg@mail.gmail.com>
- Reply-to: dominik.vogt@xxxxxx
On Fri, Oct 01, 2021 at 02:04:11AM +0200, Pier Paolo Grassi wrote:
> Hello, thanks for your insights, but I think you are kind of missing the
> point: I am already happy with what
>
> less -f <(find ...)
>
> gives me in terms of ux. Of course the output is generated continuously and
> it is stored in ram by less, having gigabytes of ram it doesn't really
> matters how much output is produced.
> The only upgrade I was looking for was to be able to do ctrl-c to dispose
> of the command even when find had not yet produced enough output to make
> less satisfied, the infamous one screenfull of text.
1) This is not an issue at all if the input comes from a regular
file.
2) With "less -f <(<command>)" it can be solved by artificially
generating at least a screen of output:
$ less -f <(repeat $LINES; echo; <command>)
> I fail to understand how it would help me to create a tmpfs and make the
> long running process write there instead of to a pipe.
There was some issue about the generating command being killed by
ctrl-c. Storing output in a tempfile solves this, and using a
ramdisk solves the disk space concerns.
> If the process
> doesn't produce output it will still hang the shell, doesn't it?
The "alias" or "shell function" solutions would run the generating
command in the backgroud, so the shell does not hang. Also, less
does not hang when input comes from a regular file, even if that
file is growing. This is a significant difference in behaviour
from taking input from a pipe.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author