# Récupération des arguments OPTS=`getopt -o i:o: -- "$@"` if [ $? != 0 ] then exit 1 fi eval set -- "$OPTS" while true ; do case "$1" in -i) input="$2"; shift 2;; -o) output="$2"; shift 2;; --) shift; break;; esac done # Si input n'est pas définie if [ -z "$input" ] then echo "available parameters :"; echo "-i /path/to/directory (can't be empty!)"; exit 1; fi # Si output n'est pas définie if [ -z "$output" ] then echo "available parameters :"; echo "-o path/to/output_file (can't be empty!)"; exit 1; fi # find + xml validation sur le répertoire find $input -name "*.fulltext.tei.xml.result.txt" -exec xmlstarlet val --well-formed {} \; >> "$output";