]> nuage.metani.fr Git - 3GPP.git/blobdiff - bin/38331-convert.sh
Add -p before mkdir
[3GPP.git] / bin / 38331-convert.sh
index cd8267bada72bc6556e19261e85fc4613363bffa..ead185983d8c60cddbe4838df09fdf9f185598d8 100755 (executable)
@@ -69,28 +69,34 @@ if [[ ! -e "${1%.docx}.asncheck" ]] ; then
     exit
 fi
 
-txt2asn.awk "${1%.docx}.txt" > "${1%.docx}-descriptions-at-IEs-end.asn"
-cat "${1%.docx}-descriptions-at-IEs-end.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}-descriptions-at-IEs-end.asncheck"
-compare1=$(diff -b -B "${1%.docx}.asncheck" "${1%.docx}-descriptions-at-IEs-end.asncheck")
+mkdir -p by-IE
+cd by-IE
+txt2asn.awk "../${1%.docx}.txt" > "${1%.docx}.asn"
+cat "${1%.docx}.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}.asncheck"
+compare1=$(diff -b -B "../${1%.docx}.asncheck" "${1%.docx}.asncheck")
 if [[ "$compare1" ]] ; then
-    echo "The ASN.1 in ${1%.docx}-descriptions-at-IEs-end.asn does not fully match with the ASN.1 in ${1%.docx}.asncheck"
+    echo "The ASN.1 in by-IE/${1%.docx}.asn does not fully match with the ASN.1 in ${1%.docx}.asncheck"
     echo "Check with:"
-    echo "  diff -b -B ${1%.docx}.asncheck ${1%.docx}-descriptions-at-IEs-end.asncheck"
+    echo "  diff -b -B by-IE/${1%.docx}.asncheck ${1%.docx}.asncheck"
 else
-    rm "${1%.docx}-descriptions-at-IEs-end.asncheck"
+    rm "${1%.docx}.asncheck"
 fi
 
-txt2asn-integrated.awk "${1%.docx}.txt" > "${1%.docx}-description-before-field.asn"
-cat "${1%.docx}-description-before-field.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}-description-before-field.asncheck"
-compare2=$(diff -b -B "${1%.docx}.asncheck" "${1%.docx}-description-before-field.asncheck")
+cd ..
+mkdir -p before-field
+cd before-field
+txt2asn-integrated.awk "../${1%.docx}.txt" > "${1%.docx}.asn"
+cat "${1%.docx}.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}.asncheck"
+compare2=$(diff -b -B "../${1%.docx}.asncheck" "${1%.docx}.asncheck")
 if [[ "$compare2" ]] ; then
-    echo "The ASN.1 in ${1%.docx}-description-before-field.asn does not fully match with the ASN.1 in ${1%.docx}.asncheck"
+    echo "The ASN.1 in before-field/${1%.docx}.asn does not fully match with the ASN.1 in ${1%.docx}.asncheck"
     echo "Check with:"
-    echo "  diff -b -B ${1%.docx}.asncheck ${1%.docx}-description-before-field.asncheck"
+    echo "  diff -b -B before-field/${1%.docx}.asncheck ${1%.docx}.asncheck"
 else
-    rm "${1%.docx}-description-before-field.asncheck"
+    rm "${1%.docx}.asncheck"
 fi
 
+cd ..
 if [[ "$compare1" ]] || [[ "$compare1" ]] ; then
     exit
 else