--- /dev/null
+#!/usr/bin/perl
+# unfoldlines.pl is a script to unfold lines when they start with a leading
+# space. It is meant to correct the output of ldapsearch making it comparable
+# to the ldif files
+# Usage: ldapsearch [...args...] | ./unfoldlines.pl > verify.out
+# if verify.out is the file to be diffed against the ldif files
+#
+
+my @lines=<>;
+
+$folded=0;
+$cnt=1;
+while ($lines[$cnt]) {
+ $line = $lines[$cnt];
+ if ($line =~ /^ /) {
+ $folded = 1;
+ $line =~ s/^ //;
+ chomp $lines[$cnt-1];
+ $line = $lines[$cnt-1] . $line;
+ print $line;
+ } else {
+ if($folded==0) {print $lines[$cnt-1];}
+ $folded=0;
+ }
+ $cnt++;
+}
+
+close(FILE);
+
esac
ldapsearch -H ldap://pcalishuttle01.cern.ch -x -b "$SEARCH,o=shuttle_prod,dc=cern,dc=ch" -L -L -L > verify.out
+cat verify.out | ./unfoldlines.pl > verify1.out
-diff --ignore-space-change --ignore-blank-lines verify.out $FILE | grep -v "> #"
+diff --ignore-space-change --ignore-blank-lines verify1.out $FILE | grep -v "> #" | grep -v '^0[a-z]'
+rm verify.out verify1.out