Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • This worked for me when piping find into grep from Node.js. Commented Jan 13, 2020 at 3:53
  • 2
    Maybe this is a case of Useless Use of Cat Award. If I need a command that does not fail I'd rather use : (or true) as stated in @cyker answer which doesn't have any other meaning than that. The : symbol infact is just a alias for true (i.e. don't fail). More info here. Commented Feb 7, 2020 at 10:29
  • 2
    @a.barbieri Not useless; you can't use : in a pipe. If you would chain the command with a logical or, than yes, but that's not what this solution does. Commented Feb 7, 2020 at 13:40
  • 1
    I see. You are right, I didn't mension that I would use || : in place of | cat, meaning I would not have done | :. Commented Feb 7, 2020 at 13:47
  • 10
    This won't work if using -o pipefail. Commented Nov 20, 2020 at 15:25