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*

7
  • Good, as usual. You may want to add in the comments I added underneath @Bregalad question? or maybe some extra ones? That way the answer will be even more complete on "how exactly does it work" (I note that you already gave a more acurate info about "]" than I did ^^) Commented Jan 11, 2017 at 12:18
  • “all Bourne-like shells (and fish) have a built-in [ command” That's true in practice in the 21st century, but I'm pretty sure I've used a shell without [. I don't remember if it was a Bourne variant or an antique version of ash. Commented Jan 11, 2017 at 22:59
  • @Gilles The Bourne shell implemented both [ and test as builtins with Unix System III. Before that, there was no [ and test was only an external binary command. Commented Jan 12, 2017 at 0:38
  • @Gilles, the original ash had test builtin (merged with expr), but optionally. According to in-ulm.de/~mascheck/various/ash, BSDs didn't have test builtin until around 2000. I've added "modern". Commented Jan 12, 2017 at 10:12
  • Why in the world would you want to do find . -exec [ f {} ] \; -print? The command find . -type f -print would do the same thing so much more efficiently... Commented Jan 12, 2017 at 18:33