Effective awk Programming by Arnold Robbins

Effective awk Programming by Arnold Robbins

Author:Arnold Robbins
Language: eng
Format: epub, mobi, pdf
ISBN: 9781491904619
Publisher: O’Reilly Media, Inc.
Published: 2015-08-26T04:00:00+00:00


function getpwnam(name) { _pw_init() return _pw_byname[name] }

Similarly, the getpwuid() function takes a user ID number argument. If that user number is in the database, it returns the appropriate line. Otherwise, it returns the null string:

function getpwuid(uid) { _pw_init() return _pw_byuid[uid] }

The getpwent() function simply steps through the database, one entry at a time. It uses _pw_count to track its current position in the _pw_bycount array:

function getpwent() { _pw_init() if (_pw_count < _pw_total) return _pw_bycount[++_pw_count] return "" }

The endpwent() function resets _pw_count to zero, so that subsequent calls to getpwent() start over again:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.