in reply to Re^2: How to replace spaces with different chars?
in thread How to replace spaces with different chars?

++ Well spotted.

If I add fidlee:

$ ls -1 a/b/c/d/e 'f:i-:l;e' 'fi:l;e' 'f-i:l;e' 'f-i-:l;e' fi:le fidlee

I get an additional line in the output:

*** Files matching 'a/b/c/d/e/fi l e': 'a/b/c/d/e/fi:l;e' a/b/c/d/e/fidlee

Changing y/ /?/ to s/ /[\\;:,-]/g fixes this. I've updated my post.

— Ken

Replies are listed 'Best First'.
Re^4: How to replace spaces with different chars?
by LanX (Saint) on Jul 07, 2022 at 13:44 UTC
      does ls really support regex-character classes?

      It isn't ls which supports it, but the shell's globbing. All shell globs support character classes inside square brackets. Well, all Bourne-like shells anyway.


      🦛

      I see ++hippo has provided an answer.

      For full documentation of what's happening, see man bash; follow the EXPANSION link; scroll down (lots) to "Pathname Expansion" for screenfuls of information.

      — Ken