OlveraeUNSW
Back to problems
COMP2041

21T2 Q5 — Years an award was not given

Args: a regex and a |-separated data filename (Award|Year|Winner|Gender|Country|Birth). The award whole name (not a substring) must match the regex. Between the first and last year any matching award was given, print — sorted — every year in which no matching award was given. If no award matches, print No award matching '<regex>'.

$ ./prog 'Nobel Prize for physics' awards.psv
1905

POSIX shell only (#!/bin/dash); standard UNIX filters; no awk, Perl, C or Python. From COMP2041/9044 21T2 Final.

Samples

stdin
expected
1905
shell
14