Falcon 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/bin/sh
fname=access.conf
groups=(`awk '/vnazarov/{print $1}' $fname`)
endline=/@$groups/;
for group in ${groups[*]}; do
group2='/@'$group' /';
endline=''$endline' || '$group2'';
# echo $group2;
done
echo $endline;
#awk ''$endline'{print}' $fname
#echo '/^[^\#.*]/ {if(/\]/ || '$endline')print $1,$3}'
#exit
awk '/^[^\#.*]/ {if(/\]/ ||$'$endline') print $1,$3}' $fname | \
awk -v RS='[' ' {gsub(/\n/," ");if($'$endline')print "["$0}' | \
awk ' {if(/rw/)print $1,"чтение / запись"; if(!/rw/)print $1,"только чтение"}'
#awk '/^[^\#.*]/ {if(/\]/ || $endline)print $1,$3}' $fname
echo $result