{"id":486,"date":"2024-11-06T23:18:08","date_gmt":"2024-11-06T23:18:08","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=486"},"modified":"2024-11-07T13:22:12","modified_gmt":"2024-11-07T13:22:12","slug":"mwnci-getgrent-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-getgrent-function\/","title":{"rendered":"Mwnci getgrent() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>getgrent<strong>(<em>[string]<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>getgrent()<\/i> function returns a hash for the given group name or Gid. If no argument is given then an array of hashes of each group entry is returned.<\/p>\n<h2>Example<\/h2>\n<pre>include(\"grp\")\r\nprintln(getgrent(\"root\"))\r\nprintln(getgrent(0))\r\nprintln(getgrent())\r\n\r\n{\"Group\": \"root\", \"Password\": \"x\", \"Gid\": 0, \"Members\": []}\r\n{\"Group\": \"root\", \"Password\": \"x\", \"Gid\": 0, \"Members\": []}\r\n[{\"Gid\": 0, \"Members\": [], \"Group\": \"root\", \"Password\": \"x\"}, {\"Password\": \"x\", \"Gid\": 1, \"Members\": [], \"Group\": \"daemon\"}, {\"Group\": \"bin\", \"Password\": \"x\", \"Gid\": 2, \"Members\": []}, {\"Gid\": 3, \"Members\": [], \"Group\": \"sys\", \"Password\": \"x\"}, {\"Gid\": 4, \"Members\": [], \"Group\": \"adm\", \"Password\": \"x\"}, {\"Gid\": 5, \"Members\": [], \"Group\": \"tty\", \"Password\": \"x\"}, {\"Gid\": 6, \"Members\": [], \"Group\": \"disk\", \"Password\": \"x\"}, {\"Members\": [], \"Group\": \"lp\", \"Password\": \"x\", \"Gid\": 7}]\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax getgrent([string]) Description The getgrent() function returns a hash for the given group name or Gid. If no argument is given then an array of hashes of each group entry is returned. Example include(&#8220;grp&#8221;) println(getgrent(&#8220;root&#8221;)) println(getgrent(0)) println(getgrent()) {&#8220;Group&#8221;: &#8220;root&#8221;, &#8220;Password&#8221;: &#8220;x&#8221;, &#8220;Gid&#8221;: 0, &#8220;Members&#8221;: []} {&#8220;Group&#8221;: &#8220;root&#8221;, &#8220;Password&#8221;: &#8220;x&#8221;, &#8220;Gid&#8221;: 0, &#8220;Members&#8221;: []} [{&#8220;Gid&#8221;: 0, &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-getgrent-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci getgrent() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-486","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":4,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/486\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/486\/revisions\/499"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}