This is
zmv
command to non-recursively replace any number of spaces with a single underscore (thanks to Stéphane Chazelas, who helped me with it):
zmv -- '* *' '${f// ##/_}'
And here is a command from the internet, that seems to do the same thing, but recursively:
zmv -- '(**/)(* *)' '$1${2//( #-## #| ##)/_}'
Could someone explain how does it work? Specifically, how the ( #-## #| ##)
part works?
Asked by jsx97
(1347 rep)
May 17, 2024, 08:52 PM
Last activity: May 17, 2024, 10:30 PM
Last activity: May 17, 2024, 10:30 PM