How do I pass an arbitrary command line argument to a native Windows program from a MinGW shell?
I would like a general solution, but a solution that works for any valid Windows filename would be acceptable.
That shell is Bash. Cygwin/MSYS2 Bash can accept Windows paths, but they need to either be quoted:
or forward slashes:
As you can see, if you are supplying Windows paths, this is pretty straight forward. The only issue you might get is if you are trying to supply Bash paths to a Windows native program:
Windows native programs have no concept of
/tmp or even
/. Cygwin/MSYS2 have
cygpath to assist in converting these paths:
program "$(cygpath /tmp/bravo.txt)"
Side note: MinGW is an old project. You should be using Cygwin or MSYS2.