classify-users: determine type of Athena accounts
[user/alex/software/my-snippets.git] / grep-owners
1 #!/bin/bash
2 # Alex Dehnert --- 2009-04-24
3 # Return only lists owned by first argument
4
5 wantowner=$1
6
7 for list in `cat`; do
8     hidden=$(athrun ops qy -s -f hidden glin $list)
9     if [[ "x$hidden" == "x" ]]; then
10         true
11     else
12     owner=$(athrun ops qy -s -f ace_name glin $list)
13     towner=$(athrun ops qy -s -f ace_type glin $list)
14     if [[ "$towner" == "LIST" ]]; then
15         if [[ "$owner" == "$wantowner" ]]; then
16             echo $list
17         fi
18     fi
19     fi
20 done