#!/bin/bash xml="$1" shift # MSYS does unix -> windows path conversion if there is a leading / # but not when the argument contains a semicolon, eg: /x -> # C:\Mingw\msys\1.0\x so we double all leading /'s to avoid this nargs=$# args=() for ((i = 0; i < nargs; i++)) ; do if [[ "$1" = /* ]] && [[ "$1" != *\;* ]] ; then args[$i]="/$1" else args[$i]="$1" fi shift done exec "$xml" "${args[@]}"