egrid-groupchg
NAME
egrid-groupchg - Filter to alter /etc/group and similar format files.
SYNOPSIS
egrid-groupchg [OPTIONS] FILE [FILE ...]
Filter to alter /etc/group and similar format files.
Options:
- -i, --input FILE
- Read FILE instead of standard input; FILE should be in the format of /etc/group.
- -o, --output FILE
- Write FILE instead of standard output; FILE will be in the format of /etc/group.
- -A, --args-from FILE
- Read additional command-line arguments from FILE as if they were typed on the command-line.
- --help
- Print help text and exit
- -V, --version
- Print version number and exit
DESCRIPTION
Reads a file in /etc/group format as input; for each FILE given on the command-line, applies all modifications specified in it (see below for the syntax); then writes the altered file as output, again in /etc/group format.
Alterations are first read from all the FILEs specified on the command line, then applied to each line of the input; for the order of potentially conflicting operations, consult section PRECEDENCE OF OPERATIONS.
If no alteration file is given on the command line, then copies input to output verbatim.
Reads standard input unless the --input option is given.
Writes to standard output unless the --output option is given.
MODIFICATION FILES
Three kinds of operations can be specified in a modification file:
- Adding users to an existing group
- A line of the form:
-
group += user1, user2 -
adds users user1 and user2 to the group named group.
-
The comma-separated list of users must appear all on one line; however, one can repeat the addition operation multiple times, with cumulative effect: the following syntax is exactly equivalent to the one given:
-
group += user1 group += user2 -
The line is ignored if group is never found in the input, group group is not created, and no warning is given.
-
No check is done on the existence of users listed.
- Removing users from a group
- A line of the form:
-
group -= user1, user2 -
removes users user1 and user2 from the group named group.
-
The comma-separated list of users must appear all on one line; however, one can repeat the addition operation multiple times, with cumulative effect: the following syntax is exactly equivalent to the one given:
-
group -= user1 group -= user2 -
No warning is issued if a user in the list is not member of the specified group.
-
The line is ignored if group is never found in the input, and no warning is given.
- Replacing the group members with another list.
- A line of the form:
-
group := user1, user2 -
makes group contain exactly the named users. The comma-separated list of users must appear all on one line.
-
The line is ignored if group is never found in the input, and no warning is given.
-
No check is done on the existence of users listed.
Blank lines and lines starting with the '#' character are ignored.
PRECEDENCE OF OPERATIONS
Operations on the groups are done in the following order:
So, if the same user name is added to a group and removed from the same group, the net effect is a deletion of the user from the group.
BUGS
The --verbose option does not yet report very much information.
DOWNLOAD
You can download RPM packages of the EGRID SE Tools from http://www.egrid.it/download/rpm/RPMS.egrid; Debian packages from http://www.egrid.it/download/deb/egrid.
You can browse the source code for this software from the EGRID CVS at http://www.egrid.it/cvs/middleware/se/
COPYRIGHT AND LICENSE
Copyright (c) 2004,2005 Riccardo Murri riccardo.murri@ictp.it for the EGRID project http://www.egrid.it/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
