1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-07 16:16:17 +02:00

Thomas Bereknyei, Mic92: 39831: find "getent" by the usual command search, not just /usr/bin/

Also tweak the replacement getent to handle /etc/hosts format.
This commit is contained in:
Barton E. Schaefer 2016-11-06 00:00:38 -07:00
parent dee0bce7b4
commit c282abc6bd
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,11 @@
2016-11-05 Barton E. Schaefer <schaefer@zsh.org>
* unposted: Completion/compaudit: tweak replacement getent
to handle /etc/hosts format.
* Thomas Bereknyei, Mic92: 39831: Completion/compaudit: find
"getent" by the usual command search, not just /usr/bin/.
* unposted: Test/A05execution.ztst: tests for 39839, 39844
* 39844: Src/loop.c: fix "while" condition as per 39839

View File

@ -15,8 +15,10 @@ compaudit() { # Define and then call
emulate -L zsh
setopt extendedglob
[[ -x /usr/bin/getent ]] || getent() {
if [[ $2 = <-> ]]; then
[[ -n $commands[getent] ]] || getent() {
if [[ $1 = hosts ]]; then
sed 's/#.*//' /etc/$1 | grep -w $2
elif [[ $2 = <-> ]]; then
grep ":$2:[^:]*$" /etc/$1
else
grep "^$2:" /etc/$1