Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: compaudit's group knowledge



This assumes that /usr/bin/getent outputs something
which looks identical to an /etc/group (it does so on
Debian and Solaris).

Index: Completion/compaudit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/compaudit,v
retrieving revision 1.3
diff -u -r1.3 compaudit
--- Completion/compaudit	2001/04/26 13:03:24	1.3
+++ Completion/compaudit	2001/09/06 20:09:50
@@ -15,6 +15,8 @@
 emulate -L zsh
 setopt extendedglob
 
+[[ -x /usr/bin/getent ]] || getent() { cat /etc/$1 }
+
 # The positional parameters are the directories to check, else fpath.
 if (( $# )); then
   local _compdir=''
@@ -87,7 +89,7 @@
   else
     (( _i_gid == EGID )) && break       # Somewhat arbitrary
   fi
-done < /etc/group
+done <<(getent group)
 
 # We search for:
 # - world/group-writable directories in fpath not owned by root and the user



Messages sorted by: Reverse Date, Date, Thread, Author