On Wed 23 Jun 2021 at 08:49:42 (+0100), mick crane wrote:
> On 2021-06-23 08:22, to...@tuxteam.de wrote:
> > On Wed, Jun 23, 2021 at 06:51:39AM +0300, Andrei POPESCU wrote:
> > 
> > [...]
> > 
> > >   comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc
> > > /var/log/installer/initial-status.gz | sed -n 's/^Package:
> > > //p' | sort -u)
> > 
> > > Command substitution without '$'? I must be missing something
> > > and would
> > > appreciate a pointer.
> > 
> > As David pointed out (as a pointer), the <(...) is a bashism for
> > "pretend this is
> > a file name whose content is provided by the enclosed command's
> > output".
> > 
> > Perhaps more readable in the symmetrical variant
> > 
> >   diff -u <(ls dir1) <(ls dir2)
> > 
> > Very handy.
> > 
> does not the excellent guide also say not to try to do anything with
> the output of "ls" ?

That would make ls effectively useless. No, the output from ls is for
parsing by eyeball, not by scripts. That's what's important.
In the example, diff doesn't parse the output, it just presents the
differences between two slabs of text for your eyeball to parse.

Cheers,
David.

Reply via email to