Bob Beers wrote:
> Part 1:
>
>
> You have a valid point, but the OP's question was:
>
> "I am looking for a (simple) shell command to run from a bash script
> that will allow me to list user accounts that belong to a particular
> group."
>
>
In all likelihood the system follows the default ap
Part 1:
On Tue, Sep 23, 2008 at 7:37 PM, Ian Blackwell <[EMAIL PROTECTED]> wrote:
> Bob Beers wrote:
>> grep : /etc/group | cut -d: -f4
>>
>> will give a comma separated list, provided is a valid group
>> name.
>>
>>
> There is one problem with this approach, which is the assumption that
> all u
Bob Beers wrote:
> grep : /etc/group | cut -d: -f4
>
> will give a comma separated list, provided is a valid group name.
>
>
There is one problem with this approach, which is the assumption that
all users' primary group is the same as their login id - which I agree
is typically the RHEL way, bu
On Tue, Sep 23, 2008 at 6:43 PM, Barry Brimer <[EMAIL PROTECTED]> wrote:
>
> The egrep is using a leading anchor (^) to make sure the grep matches the
> beginning of the line. If not, and the group pattern matched as one of the
> users it would print those lines too .. which is probably undesirabl
On Tue, 23 Sep 2008, Bob Beers wrote:
On Tue, Sep 23, 2008 at 7:26 PM, Barry Brimer <[EMAIL PROTECTED]> wrote:
Quoting Tim Alberts <[EMAIL PROTECTED]>:
Barry Brimer wrote:
With spaces separating groups:
egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/
/g'
With
Bob Beers wrote:
On Tue, Sep 23, 2008 at 7:26 PM, Barry Brimer <[EMAIL PROTECTED]> wrote:
With commas separating groups:
getent group | egrep -i '^groupname:' | awk -F : '{ print $4}'
With spaces separating groups:
getent group | egrep -i '^groupname:' | awk -F : '{ print $4}' | sed -e 's/
On Tue, Sep 23, 2008 at 7:26 PM, Barry Brimer <[EMAIL PROTECTED]> wrote:
> Quoting Tim Alberts <[EMAIL PROTECTED]>:
>
>> Barry Brimer wrote:
>> > With spaces separating groups:
>> >
>> > egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/
>> /g'
>> >
>> > With commas separati
Quoting Tim Alberts <[EMAIL PROTECTED]>:
> Barry Brimer wrote:
> > With spaces separating groups:
> >
> > egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/
> /g'
> >
> > With commas separating groups:
> >
> > egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }'
>
>
On Tue, Sep 23, 2008 at 7:11 PM, Tim Alberts <[EMAIL PROTECTED]> wrote:
> Barry Brimer wrote:
>>
>> With spaces separating groups:
>>
>> egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/
>> /g'
>>
>> With commas separating groups:
>>
>> egrep -e '^groupname:' /etc/group | a
Barry Brimer wrote:
With spaces separating groups:
egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }' | sed -e 's/,/ /g'
With commas separating groups:
egrep -e '^groupname:' /etc/group | awk -F : '{ print $4 }'
I'm sorry, I didn't specify, I'm using LDAP for user/group management.
On Tue, Sep 23, 2008 at 1:31 PM, Tim Alberts <[EMAIL PROTECTED]> wrote:
> So essentially, I am looking for a (simple) shell command to run from a bash
> script that will allow me to list user accounts that belong to a particular
> group. Any help is appreciated.
grep : /etc/group | cut -d: -f4
w
Quoting Tim Alberts <[EMAIL PROTECTED]>:
> I have several shell scripts to manage user accounts on a server. I've
> been using a file with the usernames of peoples accounts that any script
> needs to process. I had a thought that I can and should be setting up
> groups and adding user accounts t
I have several shell scripts to manage user accounts on a server. I've
been using a file with the usernames of peoples accounts that any script
needs to process. I had a thought that I can and should be setting up
groups and adding user accounts to those groups so I don't have to
maintain a s
13 matches
Mail list logo