On my system I have some command line tools which are Windows only and, in order to easily use the same build system as on Windows on my Linux machine I added a wrapper script which invokes wine on the commands and made symlinks to the wrapper with the file names as the tools, but without the '.exe' suffix.
Of course, I wanted to properly pass the parameters through the wrapper to the tools so I wrote (note the bold text):
#!/bin/shSo the answer is: use $@ and quote like I did in the code above and the parameters will be passed correctly.
wine $0.exe "$@"
Update: stbuehler suggested to use exec to replace the shell process with wine with this construct:
exec wine $0.exe "$@"
Thanks for the suggestion.