Start development on 386BSD 0.0
[unix-history] / .ref-BSD-4_3_Net_2 / usr / src / contrib / isode / others / quipu / tools / scripts / dsa2aei
#!/bin/sh
search -filter objectclass=applicationEntity -nosize -notime -nopart \
-type presentationaddress execvector supportedapplicationcontext \
-show -subtree -noseq \
| sed 's/cn=//g
s/@/ /g
s/ */ /g' | awk -F- '
BEGIN {
print "# Flat representation of Application represented in the directory"
print "# Format"
print "# host : common name : application context : address : exec vector"
print ""
}
{
if ( NF == 1 ) {
if (started == 1) {
printf ":"
if (sac != "")
printf sac
printf ":"
if (addr != "")
printf addr
printf ":"
if (exec != "")
printf exec
printf "\n"
} else
started = 1
sac = ""
exec = ""
addr = ""
n = split ($1, sp, " ")
tmp = sp[2]
for (i=3; i<=n ; i++)
tmp = tmp " " sp[i]
printf "%-14s:%-20s", sp[1], tmp
} else {
tmp = $2;
for (i=3; i<=NF ; i++)
tmp = tmp "-" $i
if ( $1 == "supportedApplicationContext ")
sac = tmp
else if ( $1 == "presentationAddress ")
addr = tmp
else if ( $1 == "execVector ") {
tmp = $2;
for (i=3; i<=NF ; i++)
tmp = tmp " -" $i
exec = tmp
} else
print "\n**ERROR**" $1 "*** unexpected"
}
}
END {
printf ":"
if (sac != "")
printf sac
printf ":"
if (addr != "")
printf addr
printf ":"
if (exec != "")
printf exec
printf "\n"
}' > quipuentities