@@ -100,7 +100,7 @@ info "The user is: '$username'"
if test -f "$allowed_users_file"
then
- rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |
+ rc=$(grep -Ev '^(#|$)' $allowed_users_file |
while read heads user_patterns
do
# does this rule apply to us?
@@ -138,7 +138,7 @@ info "'$groups'"
if test -f "$allowed_groups_file"
then
- rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |
+ rc=$(grep -Ev '^(#|$)' $allowed_groups_file |
while read heads group_patterns
do
# does this rule apply to us?
The update-hook-example.txt script uses this anti-pattern twice. Call grep with the input file name directy. While at it, merge the two consecutive grep calls. Signed-off-by: Beat Bolli <dev+git@drbeat.li> --- Documentation/howto/update-hook-example.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)