Skip to content

Instantly share code, notes, and snippets.

@fedecarg
Created March 7, 2013 11:52
Show Gist options
  • Save fedecarg/5107522 to your computer and use it in GitHub Desktop.
Save fedecarg/5107522 to your computer and use it in GitHub Desktop.
Replace LDAP entries with full names in SVN log
#!/bin/bash
# Author [email protected]
svn_url="$(svn info . | grep 'URL:' | cut -c6-)"
echo "Repository ${svn_url}"
svn log -v --xml . > templog.log
touch svnlog.log
while read line; do
if [[ "$line" == *"<author>"* ]]; then
line="<author>$(echo $line | grep -Po '(?<=CN=)*(?=\/OU)')</author>"
fi
echo $line >> svnlog.log
done < templog.log
rm -f templog.log
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment