I have a bash script that prompts a user to drag and drop a file as an input and then I need to convert that path to windows style path so I can use it as an argument to an .exe that is being called:
echo -e "\nPlease drag and drop your input audio file into this window and hit Enter\n"
read inputfile
inputfilewin=$(cygpath -w -a "${inputfile}")
echo "inputfile: $inputfile"
echo "inputfilewin: $inputfilewin"
This works fine for paths with no spaces but my Box Sync folder produces a response like this:
C:\cygwin\home\jimbob\'\cygdrive\c\Users\jimbob\Box Sync\myscripts\testscript\6ch.wav'
but if i just type on the command line cygpath -w -a and drag and drop the same file i get the right path back:
C:\Users\jimbob\Box Sync\myscripts\testscript\6ch.wav
Please help I just can't get it to work how I need
so depending on how many escape you need: