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*

4
  • Using extglob (as in @sparhawk comment) is more efficient... Commented Jan 29, 2019 at 10:57
  • @xenoid, efficient in what way? If you mean in terms of CPU time used, the difference is quite likely to be totally negligible. If you mean in terms of readability or such, do note that not everyone might be familiar with ksh-style extended globs, and they're not standard anyway, unlike the if solution Commented Jan 29, 2019 at 18:23
  • find folder/*.robot ... works but is a bit odd. You'd usually use find . -name "*.robot" ! -name "config.robot" -exec ... Of course, the latter would recurse to subdirectories, and would not keep the filenames in numerical order, while the former does exactly the opposite... Commented Jan 29, 2019 at 18:27
  • Fewer processes and shorter code. "Not everyone can be familiar...": yes, but everyone can/should learn a new trick from time to time otherwise we would still all be using the original sh. My skills improve because when I see some code I don't recognize, I try to understand where that comes from and if I can use it myself. Commented Jan 29, 2019 at 23:48