<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Tue May 21, 2013 5:21 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Tue May 21, 2013 5:21 pm</pubDate>
  <lastBuildDate>Tue May 21, 2013 5:21 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>RE: Outputting group members</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=20840#20840</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3555'&gt;shifty_ben&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 06, 2006 3:01 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Excellent Thank you &lt;img src=&quot;images/smiles/icon_biggrin.gif&quot; alt=&quot;Very Happy&quot; border=&quot;0&quot; /&gt; just what I was needing, they are all in there as a secondary group so that makes life much easier &lt;img src=&quot;images/smiles/icon_biggrin.gif&quot; alt=&quot;Very Happy&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=20840#20840</comments>
                                        <author>shifty_ben</author>
                                        <pubDate>Thu Apr 06, 2006 3:01 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=20840#20840</guid>
                                      </item>
                                      <item>
                                        <title>RE: Outputting group members</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=20832#20832</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 06, 2006 2:34 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      If they are members of webhosting ass a secondary group, you can grep this information from /etc/group&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;grep ^$&amp;#123;GROUP&amp;#125; /etc/group | cut -d&amp;#58; -f4&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
To find those that are members of the group as their primary group, you'd have to convert the group name to a numeric ID then grep /etc/passwd.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;GID=$&amp;#40;grep ^$&amp;#123;GROUP&amp;#125; /etc/group | cut -d&amp;#58; -f3&amp;#41;&lt;br /&gt;
egrep &amp;quot;.*?&amp;#58;.*?&amp;#58;.*?&amp;#58;$&amp;#123;GID&amp;#125;&amp;#58;.*&amp;quot; /etc/passwd | cut -d&amp;#58; -f1&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
should do it, although some error checking might be a good idea.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=20832#20832</comments>
                                        <author>nelz</author>
                                        <pubDate>Thu Apr 06, 2006 2:34 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=20832#20832</guid>
                                      </item>
                                      <item>
                                        <title>Outputting group members</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=20823#20823</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3555'&gt;shifty_ben&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Apr 06, 2006 1:37 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi all,&lt;br /&gt;
&lt;br /&gt;
Im currently writing a CLI frontend to manage my webserver, it has a few users on it that are all members of the group webhosting. What I seem to have come stuck on is building an offline 'database'  of this, the reason database is in apostraphies is because it will jsut be a text file with the relevant details in.&lt;br /&gt;
I can't seem to find any way of running a command that will output all the users in a specific group, in this case webhosting.&lt;br /&gt;
Im using BASH for the rest of the frontend but if any suggestions are in other languages then I should be able to incorporate that.&lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;
&lt;br /&gt;
cheers&lt;br /&gt;
Ben</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=20823#20823</comments>
                                        <author>shifty_ben</author>
                                        <pubDate>Thu Apr 06, 2006 1:37 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=20823#20823</guid>
                                      </item></channel></rss>