← 返回题目列表
UNSW COMP2041 · 中等

21T2 Q2 — 男生姓氏(Shell 管道)

stdin 给出选课数据,格式 课程|学号|姓名|计划|性别(姓名为 姓, 名,性别 M/F)。写一条单一 Shell 管道,输出男生的姓,每个姓只出现一次,按字母序排列。输入是无序的。

示例见上。


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