Closed backspaces closed 5 years ago
I think this is WAI. shx ls '[a-z]*.js'
means "list all files which start with a lower-case letter, are followed with zero or more characters, and end with '.js'." This seems to be the behavior you're seeing.
Note: shx ls
does not support regex, it supports glob patterns. So *
means "zero or more of anything" rather than "zero or more of the previous expression." It seems like you could solve this with the *(a|b|c)
pattern listed on the glob page though (I haven't tried).
Thanks! And what a great project!
Glad you appreciate it!
Very clear, thanks.
Note: here's a solution for finding just the all-lower case filenames: grep('-v', '[A-Z]')
TLDR: I want to list only the files that are all lower case .js files via:
This works fine for skipping files that start with a Capital letter (TitleCase), but not with files with an internal Capital letter (camelCase).
Details: The contents of the dir initially looks like:
And shx ls '[a-z]*.js' works as expected:
But if we now add a camelCase file:
touch fooBar.js
, the above ls includes it: shx ls '[a-z]*.js'I'm using this on a mac, latest Mojave, whose file system is case insensitive, but I don't think that is the problem.
Thanks! And what a great project!