On 19/03/2026 15:24, Laurent Lyaudet wrote:
Hello,

In some Bash scripts,
I make a call to "find" and then want to have all the lines of the
corresponding files,
prefixed with the corresponding file.
I created a hack with an always false regexp:
find ... | xargs grep -HP -v 'a(?!a)a'
A simpler solution would be:
find ... | xargs cat -H
But maybe you have something even better to propose.

Best regards,
      Laurent Lyaudet

I do use this pattern quite a bit, but use grep '' to match everything.

E.g. grep -H --color '' /proc/sys/net/ipv4/*

Given this is already easy with grep,
and grep has color highlighting wired up to it,
I'm thinking this functionality is not needed in cat(1).

cheers,
Padraig

Reply via email to