Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Forked from dirkk/saxon
Created June 5, 2020 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/6accbfc7fb60481cf5b60bcab24ad333 to your computer and use it in GitHub Desktop.
Save bdarcus/6accbfc7fb60481cf5b60bcab24ad333 to your computer and use it in GitHub Desktop.
Saxon bash script
#!/usr/bin/env bash
SAXON="/opt/saxon"
# Core and library classes
# CP="$SAXON/saxon9he.jar"
CP="$CP$(for JAR in "$SAXON"/*.jar; do echo -n ":$JAR"; done)"
# Options for virtual machine
VM=-Xmx512m
general_args=( )
vm_args=( )
while (( $# )) ; do
if [[ $1 = "-X" ]] ; then
vm_args+=( "$2" )
shift 2
else
general_args+=( "$1" )
shift
fi
done
# Run code
java -cp "$CP" $VM "${vm_args[@]}" net.sf.saxon.Query "${general_args[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment