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

Re: Close *all* file descriptors



On Mon, May 23, 2022 at 07:42:22AM +0100, Stephane Chazelas wrote:
> 2022-05-22 16:23:05 -0700, Bart Schaefer:
> [...]
> > Or even:  ${${(M)$(lsof -p $$ -F F):#f<->*}#f}
> >
> > Curiously, despite the man page for lsof asserting that PID filters
> > are applied first, if you add a -d filter to include only certain
> > types of descriptors, you get the descriptors for every process.
> [...]
>
> You also need -a for "and" (default being "or"):
>
> lsof -w -Ff -p $$ -a -d 3-999999 | sed -n 's/^f//p'
>
> (-F F would be "F  file structure address (0x<hexadecimal>)"
> according to the manual, I need -F f for fds here).

Right, the manpage says that.  On my system -F f and -F F seem to
do exactly the same.  (The "F" was a typo which I didn't notice
because of that behaviour.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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