diff --git a/bin/ocr-transform.sh b/bin/ocr-transform.sh index 34f543c..73c3296 100755 --- a/bin/ocr-transform.sh +++ b/bin/ocr-transform.sh @@ -32,6 +32,11 @@ show_version () { #{{{ main () main () { + # debug option -d -d to print all commands to the terminal + if (( DEBUG > 1 ));then + set -x + fi + local from="$1" to="$2" infile='-' outfile='-' transformer shift 2 @@ -88,7 +93,7 @@ main () { exec_saxon "${script_args[@]}" else script_args=("$infile" "$outfile" "${script_args[@]}") - "$transformer" "${script_args[@]}" + source "$transformer" "${script_args[@]}" fi } #}}} diff --git a/bin/ocr-validate.sh b/bin/ocr-validate.sh index 5b0ea9d..918ee32 100755 --- a/bin/ocr-validate.sh +++ b/bin/ocr-validate.sh @@ -31,6 +31,11 @@ show_version () { #{{{ main () main () { + # debug option -d -d to print all commands to the terminal + if (( DEBUG > 1 ));then + set -x + fi + local schema="$1" file="$2" shift 2 @@ -56,7 +61,7 @@ main () { if [[ "${OCR_VALIDATORS[$schema]}" = *.xsd ]];then "exec_xsdv" "$schema" "$file" else - "${OCR_VALIDATORS[$schema]}" "$file" + source "${OCR_VALIDATORS[$schema]}" "$file" fi } #}}}