Help for this page
Select Code to Download
Select
or
download this
perl -ni -e'print; print "uid:", $1, $/ if /^cn:(.*)/;' foo.file
Select
or
download this
perl -ni -e'print; if (/^cn:(.*)/) { my $uid = "uid:$1\n"; my $nl = <>; print $nl =~ /^uid:/ ? "": $uid, $nl}' foo.file