Search code examples
case-insensitivemksh

how to make filename match in mksh case insensitive


I'm using mksh (the MirBSD Korn Shell) on Windows 10. I'm used to the old UWin ksh not caring about case on Win7, and have been tripped up several times when 'ls' doesn't see a file because of casing:

    PC> ls *old
    ls: cannot access '*old': No such file or directory
    PC> ls *OLD
    filename.OLD  testing.OLD

I've tried "set completion-ignore-case on", "typeset -l", "shopt -s nocaseglob" and similar bash-isms. What will work for ksh?

Note: This is not a request for case insensitivity in regexps. Thanks


Solution

  • mksh developer here.

    This is not going to happen (especially not as filesystems are usually case-sensitive, and can be set to be it even on Windows/NT and Mac OSX).

    You can glob case-insensitively explicitly with ls *.[Oo][Ll][Dd], but that’s it.