Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: outputs of _users and _hosts to arrays
- X-seq: zsh-users 9154
- From: Wataru Kagawa <wkagawa@xxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: outputs of _users and _hosts to arrays
- Date: Mon, 25 Jul 2005 14:18:55 +0900
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- In-reply-to: <1050724093315.ZM20733@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <DC95ADD4-4F3C-4024-A9BE-242EC503D12C@xxxxxxxxxxxxxxxxxxxx> <1050724093315.ZM20733@xxxxxxxxxxxxxxxxxxxxxxx>
Hi Bart,
Thanks for the help.
After googling, I found out that _users extract usernames from /etc/
passwd and _hosts extract hostnames from /etc/hosts.
So, I can use parameter expansions like,
users=( ${$( cat /etc/users | cut -d : -f 1,7 | grep -v "#" )//:*/} )
hosts=( ${$( cat /etc/hosts | cut -d : -f 1,7 | grep -v "#" )//:*/} )
to get what I need.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author