Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # grep "Membership.*jira-users" entities.xml
- # -- extract the lines of XML defining members of jira-users. for JIRA 4.4, these lines look like:
- # <Membership id="10002" parentId="10002" childId="10000" membershipType="GROUP_USER" parentName="jira-users" lowerParentName="jira-users" childName="Greg.Boyington" lowerChildName="greg.boyington" directoryId="1"/>
- #
- # cut -d' ' -f12
- # -- extract just the childName attribute eg. childName="Greg.Boyington"
- #
- # awk '{FS="\""; print $2}'
- # -- extract the usernames only eg. Greg.Boyington
- #
- # sort -fr
- # -- sort the Mixed.Case and lower.case usernames alphabetically, Mixed.Case first
- #
- # uniq -i
- # -- select only the Mixed.Case usernames
- #
- # sed -i "s/$u/\L$u/g" entities.xml
- # -- replace all occurrences of $u, the Mixed.Case username, with the lowercase equivalent
- cp entities.xml entities.xml.orig
- for u in `grep "Membership.*jira-users" entities.xml.orig| cut -d' ' -f12|awk '{FS="\""; print $2}'|sort -fr|uniq -i`; do sed -i "s/$u/\L$u/g" entities.xml; done
Add Comment
Please, Sign In to add comment