@mh @CSB You are correct, DOS/Windows has never been case sensitive, but resent systems are case preserving.
Linux and Unix from which it came were always case sensitive.
What language are you scripting in? I know PowerShell has $isLinux and $isWindows environmental variables for testing that. Python may have similar.
Fun history lesion, as I understand from back in the day, DOS always rendered in all caps because devs didn't want to render "God" on screen in lower case out of respect.