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
  • @roaima That is a good suggestion, but in this case the -maxdepth 1 makes it unnecessary. Commented Apr 4, 2023 at 14:25
  • Good point. I should read more carefully Commented Apr 4, 2023 at 14:42
  • Yeah, but you probably want -mindepth 1 as well, or maybe -name '* *', or something to avoid matching . . What is this newfangled /r thing by the way? Commented Apr 4, 2023 at 14:42
  • @terdon, /r has the substitution return the resulting value, instead of modifying the original. (doc) perl -le '$a = "abc"; $b = ($a =~ s/.../xyz/r); print "$a $b"' gives abc xyz Commented Apr 6, 2023 at 21:02