diff --git a/testing/scripts/diff-remove-fields b/testing/scripts/diff-remove-fields index 7f18748a5f..3b20425f72 100755 --- a/testing/scripts/diff-remove-fields +++ b/testing/scripts/diff-remove-fields @@ -4,8 +4,8 @@ # prefix. if [ $# != 1 ]; then - echo "usage: `basename $0` " - exit 1 + echo "usage: `basename $0` " + exit 1 fi awk -v "PREFIX=$1" ' @@ -18,17 +18,15 @@ BEGIN { FS="\t"; OFS="\t"; } if ( index($i, PREFIX) == 1 ) rem[i-1] = 1; } - print; - next; +} + +/^[^#]/ { + for ( i in rem ) + # Mark that it is set, but ignore content. + $i = "+"; } { - for ( i in rem ) - # Mark that it iss set, but ignore content. - $i = "+"; - print; } - ' - diff --git a/testing/scripts/diff-remove-file-ids b/testing/scripts/diff-remove-file-ids index b34191f2c8..d6c3e7c813 100755 --- a/testing/scripts/diff-remove-file-ids +++ b/testing/scripts/diff-remove-file-ids @@ -13,13 +13,15 @@ $1 == "#path" && $2 == "files" { process = 1; } -process && column1 > 0 && column2 > 0 { - $column1 = "XXXXXXXXXXX"; - $column2 = "XXXXXXXXXXX"; +/^[^#]/ { + if ( process && column1 > 0 && column2 > 0 ) { + $column1 = "XXXXXXXXXXX"; + $column2 = "XXXXXXXXXXX"; + } } -/^#/ { - for ( i = 0; i < NF; ++i ) { +/^#fields/ { + for ( i = 2; i <= NF; ++i ) { if ( $i == "fuid" ) column1 = i - 1; diff --git a/testing/scripts/diff-remove-uids b/testing/scripts/diff-remove-uids index 3c3faae083..4d4d041b12 100755 --- a/testing/scripts/diff-remove-uids +++ b/testing/scripts/diff-remove-uids @@ -5,12 +5,14 @@ awk ' BEGIN { FS="\t"; OFS="\t"; } -column > 0 { - $column = "XXXXXXXXXXX"; +/^[^#]/ { + if ( column > 0 ) { + $column = "XXXXXXXXXXX"; } +} -/^#/ { - for ( i = 0; i < NF; ++i ) { +/^#fields/ { + for ( i = 2; i <= NF; ++i ) { if ( $i == "uid" ) column = i - 1; }