You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
601 B
29 lines
601 B
9 months ago
|
#!/bin/bash
|
||
|
|
||
|
parse() {
|
||
|
while read line; do
|
||
|
[ "${line:0:1}" = '#' -o "${line:0:1}" = ';' ] && continue
|
||
|
line="${line## *}"
|
||
|
[ -z "$line" ] && continue
|
||
|
set -- $line
|
||
|
case "$1" in
|
||
|
('u')
|
||
|
echo "user($2)"
|
||
|
echo "group($2)"
|
||
|
# TODO: user:group support
|
||
|
;;
|
||
|
('g')
|
||
|
echo "group($2)"
|
||
|
;;
|
||
|
('m')
|
||
|
echo "user($2)"
|
||
|
echo "group($3)"
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
}
|
||
|
|
||
|
while read fn; do
|
||
|
parse < "$fn"
|
||
|
done
|