On Mon, Jan 08, 2018 at 07:31:17PM +0000, Laurent Bercot wrote:
> > #!/usr/bin/execlineb -P
> > pipeline { find /sys -type f -name uevent -print0 }
> > forstdin -0 -p f importas -u f f redirfd -w 1 $f echo add
>  The problem with your script is that it's getting a lot of
> duplicates, since multiple symlinks in /sys point to the same
> directory describing your device. I'm still hoping to avoid scanning
> the entirety of /sys, so I'd like to find a correct pattern, but if
> there's no other way, I'll just scan everything discarding symlinks.
'-type f' should only find regular files, not symlinks. I don't believe
it will even recurse into symlinks by default so deduplication shouldn't
be necessary.

Colin Booth

Reply via email to