DCS grading programs

gdelete, gclear and gremove

Gdelete deletes a mark from a grades file, allowing the option of either clearing (-C) the contents of the mark in each student's record, or completely removing (-R) that mark from the record, so that the following mark value (if any) moves one place to the left. Gclear corresponds to gdelete's -C option, and gremove to its -R option.

Usage

gdelete [-C|-R] [-m markname] [files]

gclear [-m markname] [files]

gremove [-m markname] [files]

Details

Gclear or gdelete with the -C option clears the contents of the mark named markname from the grades files. All the values for that mark, in every student record, become empty. Plainly, this command must be used with care.

Gremove or gdelete with the -R option deletes the mark named markname from the grades files. All the values for that mark, in every student record, must be empty, or gdelete fails on that grades file, and skips to the next of the files, if any. To remove a mark with non-empty values in some records, call gclear (or gdelete's -C option) first.

Neither option deletes the mark definition the grades-file header; that must be done by the user, if it is required. Separate-line comments in student records are also not deleted.

If the -C|-R option is omitted, gdelete interrogates the user for it. If the mark name option is omitted, gdelete, gclear and gremove interrogate the user for it.

If no files are specified, input comes from the standard input and output goes to the standard output. In this case, the -C|-R and markname options cannot be omitted.

The "programs" gclear and gremove are actually shell scripts based on gdelete, so their error output may sometimes be misleading.

Warning

Because removing a mark from a student record shifts all later marks in the record to the "left" by one position, the final contents of the file should be examined carefully before further use. Make sure especially that the contents of the student records match the list of mark definitions in the file header.

Changes since the previous version

The -C option is completely new, and so are the gclear and gremove commands. The only other significant change is that the the mark definition cannot be removed from the grades-file header. A minor change is that more than one grades file can be processed.