X-Git-Url: https://nuage.metani.fr/gitweb/3GPP.git/blobdiff_plain/bc558c280842a6f1ae1b3c3a07c5dd0afc66a011..551b07f4893ca57b9d820c62bbdd2ad3b3660c5c:/bin/docx2asn.sh?ds=sidebyside diff --git a/bin/docx2asn.sh b/bin/docx2asn.sh index 832f134..77d3b35 100755 --- a/bin/docx2asn.sh +++ b/bin/docx2asn.sh @@ -11,12 +11,12 @@ if [[ ! -w . ]] ; then exit 1 fi -echo "platform est $platform" +platform=$(uname) case $platform in Linux) libreoffice="libreoffice" ;; CYGWIN*) libreoffice="soffice" ;; - *) print "Unkown platform $platform" + *) echo "Unkown platform $platform" exit 1;; esac @@ -54,7 +54,8 @@ while [ "$#" -gt 0 ]; do shift continue fi - + + sed -i 's/\r$//' "${1%.docx}.txt" cat "${1%.docx}.txt" | awk '/^-- ASN1START$/,/^-- ASN1STOP$/' | grep -Evxe '-- ASN1ST(ART|OP)' | grep -v '^--' | awk 'NF || p; { p = NF }' p=0 > "${1%.docx}.asn" if [[ -e "${1%.docx}.asn" ]] ; then