Re: vim
* On 2012 23 Nov 06:14 -0600, Andrei POPESCU wrote:
> On Vi, 16 nov 12, 16:33:17, Nate Bargmann wrote:
> > * On 2012 16 Nov 14:02 -0600, james gray wrote:
> > > i am using vim to add the one and only name in a usr account to the groups
> > > file for printing.
> >
> > I would use, as super user:
> >
> > # usermod -Ga lp <username>
>
> On Debian the 'adduser' tool should be used.
Unfortunately, the name alone doesn't lend itself to knowing that it
will modify a user account although the man page says:
Add an existing user to an existing group
If called with two non-option arguments, adduser will add an
existing user to an existing group.
The page is silent as to whether existing group membership is preserved
as with the command example I offered. To know it would be required for
each adminstrator to test this command due to this documentation bug.
I call this a documentation bug as 'usermod' if invoked with certain
options will remove the username from any groups not specified unless
invoked as I showed it above. The 'adduser' man page doesn't provide the
needed information on what the command exactly does. The implication is
that it *may* do the same thing as the 'usermod' example I gave. I have
not tested this to find out.
In this case, 'usermod' provides the adminstrator *exactly* the options
needed to modify a user account. A single or multiple groups may be
easily added, or the group list may be passed in such a way as to easily
remove an account from several groups at once while preserving or adding
membership in those passed. I don't see that capability in 'adduser'
although there is the complementary 'deluser' which removes a sepcific
user from a specific group. To remove an account from multiple groups
would require multiple invocations.
Power or simplicity? The choice is yours.
- Nate
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Ham radio, Linux, bikes, and more: http://www.n0nb.us
Reply to:
- References:
- vim
- From: james gray <kmzftq@gmail.com>
- Re: vim
- From: Jon Dowland <jmtd@debian.org>
- Re: vim
- From: james gray <kmzftq@gmail.com>
- Re: vim
- From: Nate Bargmann <n0nb@n0nb.us>
- Re: vim
- From: Andrei POPESCU <andreimpopescu@gmail.com>