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.

Required fields*

2
  • 1
    I'd not consider this a good option. Whatever are OP's feelings towards useless use of cat, the OP's example is simple enough that most Bash users would understand it. It's also quite portable. Now $(<file) is a lot less common, so it might result in much more WTFs; and speed gain from this operation, if such configuration is to be loaded to a variable, is probably negligible Commented Dec 13, 2016 at 12:17
  • 6
    @MatthewRock note that a lot of very bad practices are common and familiar. The useless uses of cat are one example, for i in $(cat file); do ... is another. That they are common is no reason to keep using bad tools. Which is not to say that this particular use of cat is a bad tooi, I'm not sure if there's a more portable way. Just saying that common & familiar != good. Commented Dec 13, 2016 at 12:55