]> git.uio.no Git - u/mrichter/AliRoot.git/blame - SHUTTLE/schema_prod/unfoldlines.pl
Updating configuration file for TPC.
[u/mrichter/AliRoot.git] / SHUTTLE / schema_prod / unfoldlines.pl
CommitLineData
64e6e37d 1#!/usr/bin/perl
2# unfoldlines.pl is a script to unfold lines when they start with a leading
3# space. It is meant to correct the output of ldapsearch making it comparable
4# to the ldif files
5# Usage: ldapsearch [...args...] | ./unfoldlines.pl > verify.out
6# if verify.out is the file to be diffed against the ldif files
7#
8
9my @lines=<>;
10
11$folded=0;
12$cnt=1;
13while ($lines[$cnt]) {
14 $line = $lines[$cnt];
15 if ($line =~ /^ /) {
16 $folded = 1;
17 $line =~ s/^ //;
18 chomp $lines[$cnt-1];
19 $line = $lines[$cnt-1] . $line;
20 print $line;
21 } else {
22 if($folded==0) {print $lines[$cnt-1];}
23 $folded=0;
24 }
25 $cnt++;
26}
27
28close(FILE);
29