File: xmlstarlet.msys

package info (click to toggle)
xmlstarlet 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,412 kB
  • ctags: 656
  • sloc: sh: 4,735; ansic: 4,183; xml: 1,936; makefile: 70; awk: 43
file content (21 lines) | stat: -rwxr-xr-x 450 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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[@]}"