Usage
This command requires at least three parameters: the field to use as a key, the value to search for in that field, and at least one destination field to output. Additional fields may be specified. These fields will then be printed to standard output, colon-delimited, with one classlist entry per line.
This utility automatically reads in the classlist, exceptionlist, and coursestaff files for the current term to reduce command-line bloat and automatically allow a variety of manipulation of the current term. For example, to get a list of userids of all students taught by d3prof (using bash):
for lec in $(get_classlist_info userid d3prof lecture | tr , "\n"); do
get_classlist_info lecture "$lec" type userid | grep '^student' | cut -f2 -d:
done
Note that
get_classlist_info is designed to be simple and can only filter based on a single criterion. To do more manipulation, it is necessary either to invoke external commands (as with
grep in the above example) or to use the Classlist.pm module directly.