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

Re: outputs of _users and _hosts to arrays



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