examples/xmlstarlet.msys
raw| 1 | #!/bin/bash |
| 2 | |
| 3 | xml="$1" |
| 4 | shift |
| 5 | |
| 6 | # MSYS does unix -> windows path conversion if there is a leading / |
| 7 | # but not when the argument contains a semicolon, eg: /x -> |
| 8 | # C:\Mingw\msys\1.0\x so we double all leading /'s to avoid this |
| 9 | |
| 10 | nargs=$# |
| 11 | args=() |
| 12 | for ((i = 0; i < nargs; i++)) ; do |
| 13 | if [[ "$1" = /* ]] && [[ "$1" != *\;* ]] ; then |
| 14 | args[$i]="/$1" |
| 15 | else |
| 16 | args[$i]="$1" |
| 17 | fi |
| 18 | shift |
| 19 | done |
| 20 | |
| 21 | exec "$xml" "${args[@]}" |