Software Construction

Course Resources

Administrivia: Course Outline | Course Timetable | Help Sessions
Administrivia: COMP2041 Handbook | COMP9044 Handbook
Meet the Team: Our Team
Platforms: Lectures (via YouTube) | Tut-Labs (via BbCollaborate (via Moodle)) | Course Forum
Assessment: Autotests, Submissions, Marks | Give online: submission | Give online: sturec
Assignment Specifications: Assignment 1

Course Content Week-by-Week

Tutorial
Laboratory
Monday Week 1 Lecture Topics
Thursday Week 1 Lecture Topics
Tutorial
Laboratory
Monday Week 2 Lecture Topics
Thursday Week 2 Lecture Topics
Tutorial
Laboratory
Weekly Test
Thursday Week 3 Lecture Topics
Tutorial
Laboratory
Weekly Test
Monday Week 4 Lecture Topics
Thursday Week 4 Lecture Topics
Tutorial
Laboratory
Monday Week 5 Lecture Topics
Thursday Week 5 Lecture Topics

Course Content Topic-by-Topic

Course Intro
Filters
regex101: online regex tester RegExr: online regex tester

#include <stdio.h>
#include <stdlib.h>

// write bytes of stream to stdout
void process_stream(FILE *stream) {
    int byte;
    while ((byte = fgetc(stream)) != EOF) {
        if (fputc(byte, stdout) == EOF) {
            perror("cat:");
            exit(1);
        }
    }
}

// process files given as arguments
// if no arguments process stdin
int main(int argc, char *argv[]) {

    if (argc == 1) {
        process_stream(stdin);
    } else {
        for (int i = 1; i < argc; i++) {
            FILE *in = fopen(argv[i], "r");
            if (in == NULL) {
                fprintf(stderr, "%s: %s: ", argv[0], argv[i]);
                perror("");
                return 1;
            }
            process_stream(in);
            fclose(in);
        }
    }

    return 0;
}

Download cat.c



import sys


def process_stream(stream):
    """
    copy bytes of f to stdout
    """
    for line in stream:
        print(line, end="")


def main():
    """
    process files given as arguments, if no arguments process stdin
    """
    if not sys.argv[1:]:
        process_stream(sys.stdin)
    else:
        for pathname in sys.argv[1:]:
            with open(pathname, "r") as f:
                process_stream(f)


if __name__ == "__main__":
    main()

Download cat.py



#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// print lines containing the specified substring
void process_stream(FILE *stream, char *name, char *substring) {
    char *line = NULL;
    size_t line_size = 0;
    int line_number = 1;

    while (getline(&line, &line_size, stream) > 0) {
        if (strstr(line, substring) != NULL) {
            printf("%s:%d:%s", name, line_number, line);
        }
        line_number++;
    }

    free(line);
}

// process files given as arguments
// if no arguments process stdin
int main(int argc, char *argv[]) {

    if (argc == 2) {
        process_stream(stdin, "<stdin>", argv[1]);
    } else {
        for (int i = 2; i < argc; i++) {
            FILE *in = fopen(argv[i], "r");
            if (in == NULL) {
                fprintf(stderr, "%s: %s: ", argv[0], argv[i]);
                perror("");
                return 1;
            }
            process_stream(in, argv[i], argv[1]);
            fclose(in);
        }
    }

    return 0;
}

Download fgrep.c



import sys


def process_stream(f, name, substring):
    """
    print lines containing substring
    """
    for (line_number, line) in enumerate(f, start=1):
        if substring in line:
            print(f'{name}:{line_number}:{line}', end='')


def main():
    """
    process files given as arguments, if no arguments process stdin
    """
    if len(sys.argv) == 2:
        process_stream(sys.stdin, "<stdin>", sys.argv[1])
    elif len(sys.argv) > 2:
        for pathname in sys.argv[2:]:
            with open(pathname, 'r') as f:
                process_stream(f, pathname, sys.argv[1])


if __name__ == '__main__':
    main()

Download fgrep.py


#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

// count lines, words, chars in stream
// assumes Unix-like line separator '\n'
// breaks on other platforms, see https://en.wikipedia.org/wiki/Newline

void process_stream(FILE *in, char *name) {
    int n_lines = 0;
    int n_words = 0;
    int n_chars = 0;
    int in_word = 0;
    int c;

    while ((c = fgetc(in)) != EOF) {
        n_chars++;

        if (c == '\n') {
            n_lines++;
        }

        if (isspace(c)) {
            in_word = 0;
        } else if (!in_word) {
            in_word = 1;
            n_words++;
        }
    }

    printf("%d %d %d %s\n", n_lines, n_words, n_chars, name);
}

// process files given as arguments
// if no arguments process stdin
int main(int argc, char *argv[]) {
    if (argc == 1) {
        process_stream(stdin, "stdin");
    } else {
        for (int i = 1; i < argc; i++) {
            FILE *in = fopen(argv[i], "r");
            if (in == NULL) {
                fprintf(stderr, "%s: %s: ", argv[0], argv[i]);
                perror("");
                return 1;
            }
            process_stream(in, argv[i]);
            fclose(in);
        }
    }
    return 0;
}

Download wc.c



import sys
import os


def process_stream(stream):
    """
    count lines, words, chars in stream
    """
    lines = 0
    words = 0
    characters = 0
    for line in stream:
        lines += line.endswith(os.linesep)
        words += len(line.split())
        characters += len(line)
    print(f"{lines:>6} {words:>6} {characters:>6}", end="")


def main():
    """
    process files given as arguments, if no arguments process stdin
    """
    if not sys.argv[1:]:
        process_stream(sys.stdin)
    else:
        for pathname in sys.argv[1:]:
            with open(pathname, "r") as f:
                process_stream(f)
                print(f" {pathname}")


if __name__ == "__main__":
    main()

Download wc.py


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

// cope stream to stdout except for repeated lines
void process_stream(FILE *stream) {
    char *line = NULL;
    size_t line_size = 0;
    char *last_line = NULL;
    size_t last_line_size = 0;

    while (getline(&line, &line_size, stream) > 0) {
        if (last_line == NULL || strcmp(line, last_line) != 0) {
            fputs(line, stdout);
        }

        // grow last_line if line has grown
        if (last_line_size != line_size) {
            last_line = realloc(last_line, line_size);
            assert(last_line != NULL);
            last_line_size = line_size;
        }

        strncpy(last_line, line, line_size);
    }

    free(line);
    free(last_line);
}

// process files given as arguments
// if no arguments process stdin
int main(int argc, char *argv[]) {
    if (argc == 1) {
        process_stream(stdin);
    } else {
        FILE *in = fopen(argv[1], "r");
        if (in == NULL) {
            fprintf(stderr, "%s: %s: ", argv[0], argv[1]);
            perror("");
            return 1;
        }
        process_stream(in);
        fclose(in);
    }

    return 0;
}

Download uniq.c



import sys


def process_stream(stream):
    """
    copy stream to stdout except for repeated lines
    """
    last_line = None
    for line in stream:
        if last_line is None or line != last_line:
            print(line, end='')
        last_line = line


def main():
    """
    process files given as arguments, if no arguments process stdin
    """
    if not sys.argv[1:]:
        process_stream(sys.stdin)
    else:
        for pathname in sys.argv[1:]:
            with open(pathname, 'r') as f:
                process_stream(f)


if __name__ == '__main__':
    main()

Download uniq.py



import sys


def process_stream(f):
    """
    print lines of stream in sorted order
    """
    print("".join(sorted(f)), end="")


def main():
    """
    process files given as arguments, if no arguments process stdin
    """
    if len(sys.argv) == 1:
        process_stream(sys.stdin)
    else:
        with open(sys.argv[1], 'r') as f:
            process_stream(f)


if __name__ == '__main__':
    main()

Download sort.py



import subprocess
import sys

# the real xargs runs the command multiple times if input is large
# the real xargs treats quotes specially


def main():
    input_words = [w for line in sys.stdin for w in line.split()]
    command = sys.argv[1:]
    subprocess.run(command + input_words)


if __name__ == "__main__":
    main()

Download xargs.py

This file contains examples of the use of the most common Unix filter programs (grep, wc, head, etc.) It also contains solutions to the exercises discussed in lectures.
  1. Consider a a file course_codes containing UNSW course codes and names.
    ls -l course_codes
    -rw-r--r-- 1 cs2041 cs2041 643938 Jun  2 13:38 course_codes
    
    wc course_codes
     19424  84534 643938 course_codes
    
    head course_codes
    ACCT1501	Accounting & Financial Mgt 1A
    ACCT1511	Accounting & Financial Mgt 1B
    ACCT2101	Industry Placement 1
    ACCT2507	Intro to Accounting Research
    ACCT2522	Management Accounting 1
    ACCT2532	Management Accounting (Hons)
    ACCT2542	Corporate Financial Reporting
    ACCT2552	Corporate Financial Rep (Hons)
    ACCT3202	Industry Placement 2
    ACCT3303	Industry Placement 3
    
    It looks like the code is separated from the title by a number of spaces. We can check this via cat -A:
    head -5 course_codes | cat -A
    ACCT1501^IAccounting & Financial Mgt 1A$
    ACCT1511^IAccounting & Financial Mgt 1B$
    ACCT2101^IIndustry Placement 1$
    ACCT2507^IIntro to Accounting Research$
    ACCT2522^IManagement Accounting 1$
    
    This shows us that our initial guess was wrong, and there's actually a tab character between the course code and title (shown as ^I by cat -A). Also, the location of the end-of-line marker ($) indicates that there are no trailing spaces or tabs.

    If we need to know what COMP courses there are:

    grep -E -c COMP course_codes
    229
    
    grep -E COMP course_codes
    COMP0011	Fundamentals of Computing
    COMP1000	Web, Spreadsheets & Databases
    COMP1001	Introduction to Computing
    COMP1010	The Art of Computing
    COMP1011	Computing 1A
    COMP1021	Computing 1B
    COMP1081	Harnessing the Power of IT
    COMP1091	Solving Problems with Software
    COMP1400	Programming for Designers
    COMP1511	Programming Fundamentals
    COMP1521	Computer Systems Fundamentals
    COMP1531	Software Eng Fundamentals
    COMP1711	Higher Computing 1A
    COMP1721	Higher Computing 1B
    COMP1911	Computing 1A
    COMP1917	Computing 1
    COMP1921	Computing 1B
    COMP1927	Computing 2
    COMP2011	Data Organisation
    COMP2021	Digital System Structures
    COMP2041	Software Construction
    COMP2091	Computing 2
    COMP2110	Software System Specification
    COMP2111	System Modelling and Design
    COMP2121	Microprocessors & Interfacing
    COMP2411	Logic and Logic Programming
    COMP2511	O-O Design & Programming
    COMP2521	Data Structures and Algorithms
    COMP2711	Higher Data Organisation
    COMP2811	Computing B
    COMP2911	Eng. Design in Computing
    COMP2920	Professional Issues and Ethics
    COMP3111	Software Engineering
    COMP3120	Introduction to Algorithms
    COMP3121	Algorithms & Programming Tech
    COMP3131	Programming Languages & Compil
    COMP3141	Software Sys Des&Implementat'n
    COMP3151	Foundations of Concurrency
    COMP3152	Comparative Concurrency Semant
    COMP3153	Algorithmic Verification
    COMP3161	Concepts of Programming Lang.
    COMP3171	Object-Oriented Programming
    COMP3211	Computer Architecture
    COMP3221	Microprocessors & Embedded Sys
    COMP3222	Digital Circuits and Systems
    COMP3231	Operating Systems
    COMP3241	Real Time Systems
    COMP3311	Database Systems
    COMP3331	Computer Networks&Applications
    COMP3411	Artificial Intelligence
    COMP3421	Computer Graphics
    COMP3431	Robotic Software Architecture
    COMP3441	Security Engineering
    COMP3511	Human Computer Interaction
    COMP3601	Design Project A
    COMP3710	Software Project Management
    COMP3711	Software Project Management
    COMP3720	Total Quality Management
    COMP3821	Ext Algorithms&Prog Techniques
    COMP3881	Ext Digital Circuits & Systems
    COMP3891	Ext Operating Systems
    COMP3900	Computer Science Project
    COMP3901	Special Project A
    COMP3902	Special Project B
    COMP3931	Ext Computer Networks & App
    COMP4001	Object-Oriented Software Dev
    COMP4002	Logic Synthesis & Verification
    COMP4003	Industrial Software Developmen
    COMP4011	Web Applications Engineering
    COMP4012	Occasional Elec S2 - Comp.Eng.
    COMP4121	Advanced & Parallel Algorithms
    COMP4128	Programming Challenges
    COMP4131	Programming Language Semantics
    COMP4132	Adv. Functional Programming
    COMP4133	Advanced Compiler Construction
    COMP4141	Theory of Computation
    COMP4151	Algorithmic Verification
    COMP4161	Advanced Verification
    COMP4181	Language-based Software Safety
    COMP4211	Adv Architectures & Algorithms
    COMP4314	Next Generation Database Systs
    COMP4317	XML and Databases
    COMP4335	Wireless Mesh&Sensor Networks
    COMP4336	Mobile Data Networking
    COMP4337	Securing Fixed & Wireless Netw
    COMP4411	Experimental Robotics
    COMP4412	Introduction to Modal Logic
    COMP4415	First-order Logic
    COMP4416	Intelligent Agents
    COMP4418	Knowledge Representation
    COMP4431	Game Design Workshop
    COMP4432	Game Design Studio
    COMP4442	Advanced Computer Security
    COMP4511	User Interface Design & Constr
    COMP4601	Design Project B
    COMP4903	Industrial Training
    COMP4904	Industrial Training 1
    COMP4905	Industrial Training 2
    COMP4906	Industrial Training 3
    COMP4910	Thesis Part A
    COMP4911	Thesis Part B
    COMP4913	Computer Science 4 Honours P/T
    COMP4914	Computer Science 4 Honours F/T
    COMP4920	Management and Ethics
    COMP4930	Thesis Part A
    COMP4931	Thesis Part B
    COMP4941	Thesis Part B
    COMP4951	Research Thesis A
    COMP4952	Research Thesis B
    COMP4953	Research Thesis C
    COMP4961	Computer Science Thesis A
    COMP4962	Computer Science Thesis B
    COMP4963	Computer Science Thesis C
    COMP6080	Web Front-End Programming
    COMP6324	IoT Services Engineering
    COMP6441	Security Engineering
    COMP6443	Web Application Security
    COMP6445	Digital Forensics
    COMP6447	Security Assessment
    COMP6448	Security Masterclass
    COMP6451	Cryptocurrency and DLT
    COMP6452	Blockchain App Architecture
    COMP6714	Info Retrieval and Web Search
    COMP6721	(In-)Formal Methods
    COMP6731	Combinatorial Data Processing
    COMP6733	Internet of Things
    COMP6741	Parameterized & Exact Comp.
    COMP6752	Modelling Concurrent Systems
    COMP6771	Advanced C++ Programming
    COMP6841	Extended Security Engineering
    COMP6843	Extended WebApp Security
    COMP6845	Extended Digital Forensics
    COMP9000	Special Program
    COMP9001	E-Commerce Technologies
    COMP9008	Software Engineering
    COMP9009	Adv Topics in Software Eng
    COMP9015	Issues in Computing
    COMP9018	Advanced Graphics
    COMP9020	Foundations of Comp. Science
    COMP9021	Principles of Programming
    COMP9022	Digital Systems Structures
    COMP9024	Data Structures & Algorithms
    COMP9031	Internet Programming
    COMP9032	Microprocessors & Interfacing
    COMP9041	Software Construction
    COMP9044	Software Construction
    COMP9081	Harnessing the Power of IT
    COMP9101	Design &Analysis of Algorithms
    COMP9102	Programming Lang & Compilers
    COMP9103	Algorithms & Comp. Complexity
    COMP9104	Quantum ICT
    COMP9116	S'ware Dev: B-Meth & B-Toolkit
    COMP9117	Software Architecture
    COMP9151	Foundations of Concurrency
    COMP9152	Comparative Concurrency Semant
    COMP9153	Algorithmic Verification
    COMP9154	Foundations of Concurrency
    COMP9161	Concepts of Programming Lang.
    COMP9164	Concepts of Programming Lang.
    COMP9171	Object-Oriented Programming
    COMP9181	Language-based Software Safety
    COMP9201	Operating Systems
    COMP9211	Computer Architecture
    COMP9221	Microprocessors & Embedded Sys
    COMP9222	Digital Circuits and Systems
    COMP9231	Integrated Digital Systems
    COMP9242	Advanced Operating Systems
    COMP9243	Distributed Systems
    COMP9244	Software View of Proc Architec
    COMP9245	Real-Time Systems
    COMP9282	Ext Micros & Interfacing
    COMP9283	Ext Operating Systems
    COMP9301	Cyber Security Project
    COMP9302	Cyber Security Project B
    COMP9311	Database Systems
    COMP9312	Data Analytics for Graphs
    COMP9313	Big Data Management
    COMP9314	Next Generation Database Systs
    COMP9315	Database Systems Implementat'n
    COMP9316	eCommerce Implementation
    COMP9317	XML and Databases
    COMP9318	Data Warehousing & Data Mining
    COMP9319	Web Data Compression & Search
    COMP9321	Data Services Engineering
    COMP9322	Software Service Design & Eng
    COMP9323	e-Enterprise Project
    COMP9331	Computer Networks&Applications
    COMP9332	Network Routing and Switching
    COMP9333	Advanced Computer Networks
    COMP9334	Systems Capacity Planning
    COMP9335	Wireless Mesh&Sensor Networks
    COMP9336	Mobile Data Networking
    COMP9337	Securing Fixed & Wireless Netw
    COMP9414	Artificial Intelligence
    COMP9415	Computer Graphics
    COMP9416	Knowledge Based Systems
    COMP9417	Machine Learning & Data Mining
    COMP9418	Advanced Machine Learning
    COMP9431	Robotic Software Architecture
    COMP9433	Comp. Methods for Robotics
    COMP9434	Robotic Software Architecture
    COMP9441	Security Engineering
    COMP9444	Neural Networks, Deep Learning
    COMP9447	Security Engineering Workshop
    COMP9491	Applied AI
    COMP9511	Human Computer Interaction
    COMP9514	Advanced Decision Theory
    COMP9515	Pattern Classification
    COMP9517	Computer Vision
    COMP9518	Pattern Recognition
    COMP9519	Multimedia Systems
    COMP9520	Ext Foundations of Computer Sc
    COMP9596	Research Project
    COMP9790	Principles of GNSS Positioning
    COMP9791	Modern Navigation &Positioning
    COMP9801	Ext Design&Analysis of Algo
    COMP9814	Ext Artificial Intelligence
    COMP9833	Ext Computer Networks & Appl
    COMP9844	Ext Neural Nets, Deep Learning
    COMP9900	Info Tech Project
    COMP9901	P/T Res. Thesis Comp Sci & Eng
    COMP9902	Res. Thesis Comp Sci & Eng F/T
    COMP9910	Mgt&Com Skills-CompSci&Eng Res
    COMP9912	Project (24 UOC)
    COMP9930	Readings in Comp Sci and Eng
    COMP9945	Research Project
    COMP9991	Research Project A
    COMP9992	Research Project B
    COMP9993	Research Project C
    
    Either of the two commands below tell us which courses have "comp" in their name or code (in upper or lower case).
    tr A-Z a-z 
    aciv2518	eng computational methods 1
    acsc1600	computer science 1
    acsc1800	computer science 1e
    acsc2015	interactive computer graphics
    acsc2020	computer science core b2
    acsc2021	computer systems architectrue 2
    acsc2107	computer languages b
    acsc2601	computer science 2a
    acsc2602	computer science 2b
    acsc2802	computer science 2ee
    acsc3003	computer project
    acsc3029	computing project 3
    acsc3030	cryptography & computer securi
    acsc3601	computer science 3a
    acsc3603	computer science 3c
    acsc4191	computer science 4 (hons) f/t
    acsc7304	computer graphics
    acsc7306	computer speech processing
    acsc7336	computer security
    acsc8248	computer graphics (12 cpt)
    acsc9000	computer science research f/t
    acsc9001	computer science research p/t
    aele2007	computer design
    aele2508	microcomputer interfacing
    aele3031	microcomputer interfacing
    aele4511	computer control theory
    amat3107	complex variables
    amat3401	complex analysis 3e
    amat3503	complex variables e
    amec3512	pumps, turbines & compressors
    ance8001	computational mathematics
    ance8002	supercomputing techniques
    ance9105	comp techniques fluid dynamics
    aphy3028	computational physics
    arch1391	digital computation studio
    arch5202	computer applications 2
    arch5203	computer applications 3
    arch5205	theory of architectural computin
    arch5220	computer graphics programming 1
    arch5221	computer graphics programming 2
    arch5223	computer applications 2
    arch5940	theory of architectural computin
    arch5942	arctitectural computing seminar
    arch5943	theory of architectural computin
    arch6201	architectural computing 1
    arch6205	architectural computing 2
    arch6214	architectural computing 2
    arch7204	design computing theory
    arch7205	computer graphics programming
    arts2301	computers, brains & minds
    atax0002	computer information systems
    atax0053	acct for complex struct & inst
    atax0324	gst: complex issues & planning
    atax0341	comparative tax systems
    atax0424	gst: complex issues & planning
    atax0441	comparative tax systems
    atax0524	gst: complex issues & planning
    atax0641	comparative tax systems
    aust2003	aborig. studies: a global compar
    aven1500	computing for aviation
    beil0003	be annual design competition
    beil0004	design competitions and bids
    benv1141	computers and information tech
    benv1242	computer-aided design
    benv2405	computer graphics programming
    benv7503	geocomputation
    binf3020	computational bioinformatics
    binf9020	computational bioinformatics
    biom5912	comp thesis b&c
    biom5920	thesis part a (comp)
    biom5921	thesis part b (comp)
    biom9332	biocompatibility
    biom9501	computing for biomedical eng
    biom9601	biomed applic.of microcomp 1
    biom9602	biomed applic.of microcomp 2
    bios3021	comparative animal physiology
    bldg2281	introduction to computing
    bldg3282	computer apps in building
    bldg3482	computer aplications in constr
    ceic5310	computing studies in the process
    ceic6711	complex fluids
    ceic8310	computing studies proc ind
    ceic8335	adv computer methods
    chem3031	inorg chem:trans metals & comp
    chem3640	computers in chemistry
    civl1015	computing
    civl1106	computing & graphics
    civl3015	engineering computations
    civl3106	engineering computations
    cmed9517	adv biostatistic & stat comp
    code1110	computational design theory 1
    code1150	computational design i
    code1210	computational design theory 2
    code2110	computational design theory 3
    code2121	advanced computational design
    code2132	computational design studio iv
    cofa2682	multi-media computing unit 3
    cofa3681	multi-media computing elective 1
    cofa5116	design & computers
    cofa5130	typography & composition
    cofa5216	design & computers 1
    cofa5240	design & computers 2 cad
    cofa5241	design & computers 2 graphics
    cofa5338	design & computers 3 - cad
    cofa5339	design & computers 3 - graphic
    cofa8670	intro to multi-media computing
    comd2040	of tigers & pussycats: a compa
    comp0011	fundamentals of computing
    comp1000	web, spreadsheets & databases
    comp1001	introduction to computing
    comp1010	the art of computing
    comp1011	computing 1a
    comp1021	computing 1b
    comp1081	harnessing the power of it
    comp1091	solving problems with software
    comp1400	programming for designers
    comp1511	programming fundamentals
    comp1521	computer systems fundamentals
    comp1531	software eng fundamentals
    comp1711	higher computing 1a
    comp1721	higher computing 1b
    comp1911	computing 1a
    comp1917	computing 1
    comp1921	computing 1b
    comp1927	computing 2
    comp2011	data organisation
    comp2021	digital system structures
    comp2041	software construction
    comp2091	computing 2
    comp2110	software system specification
    comp2111	system modelling and design
    comp2121	microprocessors & interfacing
    comp2411	logic and logic programming
    comp2511	o-o design & programming
    comp2521	data structures and algorithms
    comp2711	higher data organisation
    comp2811	computing b
    comp2911	eng. design in computing
    comp2920	professional issues and ethics
    comp3111	software engineering
    comp3120	introduction to algorithms
    comp3121	algorithms & programming tech
    comp3131	programming languages & compil
    comp3141	software sys des&implementat'n
    comp3151	foundations of concurrency
    comp3152	comparative concurrency semant
    comp3153	algorithmic verification
    comp3161	concepts of programming lang.
    comp3171	object-oriented programming
    comp3211	computer architecture
    comp3221	microprocessors & embedded sys
    comp3222	digital circuits and systems
    comp3231	operating systems
    comp3241	real time systems
    comp3311	database systems
    comp3331	computer networks&applications
    comp3411	artificial intelligence
    comp3421	computer graphics
    comp3431	robotic software architecture
    comp3441	security engineering
    comp3511	human computer interaction
    comp3601	design project a
    comp3710	software project management
    comp3711	software project management
    comp3720	total quality management
    comp3821	ext algorithms&prog techniques
    comp3881	ext digital circuits & systems
    comp3891	ext operating systems
    comp3900	computer science project
    comp3901	special project a
    comp3902	special project b
    comp3931	ext computer networks & app
    comp4001	object-oriented software dev
    comp4002	logic synthesis & verification
    comp4003	industrial software developmen
    comp4011	web applications engineering
    comp4012	occasional elec s2 - comp.eng.
    comp4121	advanced & parallel algorithms
    comp4128	programming challenges
    comp4131	programming language semantics
    comp4132	adv. functional programming
    comp4133	advanced compiler construction
    comp4141	theory of computation
    comp4151	algorithmic verification
    comp4161	advanced verification
    comp4181	language-based software safety
    comp4211	adv architectures & algorithms
    comp4314	next generation database systs
    comp4317	xml and databases
    comp4335	wireless mesh&sensor networks
    comp4336	mobile data networking
    comp4337	securing fixed & wireless netw
    comp4411	experimental robotics
    comp4412	introduction to modal logic
    comp4415	first-order logic
    comp4416	intelligent agents
    comp4418	knowledge representation
    comp4431	game design workshop
    comp4432	game design studio
    comp4442	advanced computer security
    comp4511	user interface design & constr
    comp4601	design project b
    comp4903	industrial training
    comp4904	industrial training 1
    comp4905	industrial training 2
    comp4906	industrial training 3
    comp4910	thesis part a
    comp4911	thesis part b
    comp4913	computer science 4 honours p/t
    comp4914	computer science 4 honours f/t
    comp4920	management and ethics
    comp4930	thesis part a
    comp4931	thesis part b
    comp4941	thesis part b
    comp4951	research thesis a
    comp4952	research thesis b
    comp4953	research thesis c
    comp4961	computer science thesis a
    comp4962	computer science thesis b
    comp4963	computer science thesis c
    comp6080	web front-end programming
    comp6324	iot services engineering
    comp6441	security engineering
    comp6443	web application security
    comp6445	digital forensics
    comp6447	security assessment
    comp6448	security masterclass
    comp6451	cryptocurrency and dlt
    comp6452	blockchain app architecture
    comp6714	info retrieval and web search
    comp6721	(in-)formal methods
    comp6731	combinatorial data processing
    comp6733	internet of things
    comp6741	parameterized & exact comp.
    comp6752	modelling concurrent systems
    comp6771	advanced c++ programming
    comp6841	extended security engineering
    comp6843	extended webapp security
    comp6845	extended digital forensics
    comp9000	special program
    comp9001	e-commerce technologies
    comp9008	software engineering
    comp9009	adv topics in software eng
    comp9015	issues in computing
    comp9018	advanced graphics
    comp9020	foundations of comp. science
    comp9021	principles of programming
    comp9022	digital systems structures
    comp9024	data structures & algorithms
    comp9031	internet programming
    comp9032	microprocessors & interfacing
    comp9041	software construction
    comp9044	software construction
    comp9081	harnessing the power of it
    comp9101	design &analysis of algorithms
    comp9102	programming lang & compilers
    comp9103	algorithms & comp. complexity
    comp9104	quantum ict
    comp9116	s'ware dev: b-meth & b-toolkit
    comp9117	software architecture
    comp9151	foundations of concurrency
    comp9152	comparative concurrency semant
    comp9153	algorithmic verification
    comp9154	foundations of concurrency
    comp9161	concepts of programming lang.
    comp9164	concepts of programming lang.
    comp9171	object-oriented programming
    comp9181	language-based software safety
    comp9201	operating systems
    comp9211	computer architecture
    comp9221	microprocessors & embedded sys
    comp9222	digital circuits and systems
    comp9231	integrated digital systems
    comp9242	advanced operating systems
    comp9243	distributed systems
    comp9244	software view of proc architec
    comp9245	real-time systems
    comp9282	ext micros & interfacing
    comp9283	ext operating systems
    comp9301	cyber security project
    comp9302	cyber security project b
    comp9311	database systems
    comp9312	data analytics for graphs
    comp9313	big data management
    comp9314	next generation database systs
    comp9315	database systems implementat'n
    comp9316	ecommerce implementation
    comp9317	xml and databases
    comp9318	data warehousing & data mining
    comp9319	web data compression & search
    comp9321	data services engineering
    comp9322	software service design & eng
    comp9323	e-enterprise project
    comp9331	computer networks&applications
    comp9332	network routing and switching
    comp9333	advanced computer networks
    comp9334	systems capacity planning
    comp9335	wireless mesh&sensor networks
    comp9336	mobile data networking
    comp9337	securing fixed & wireless netw
    comp9414	artificial intelligence
    comp9415	computer graphics
    comp9416	knowledge based systems
    comp9417	machine learning & data mining
    comp9418	advanced machine learning
    comp9431	robotic software architecture
    comp9433	comp. methods for robotics
    comp9434	robotic software architecture
    comp9441	security engineering
    comp9444	neural networks, deep learning
    comp9447	security engineering workshop
    comp9491	applied ai
    comp9511	human computer interaction
    comp9514	advanced decision theory
    comp9515	pattern classification
    comp9517	computer vision
    comp9518	pattern recognition
    comp9519	multimedia systems
    comp9520	ext foundations of computer sc
    comp9596	research project
    comp9790	principles of gnss positioning
    comp9791	modern navigation &positioning
    comp9801	ext design&analysis of algo
    comp9814	ext artificial intelligence
    comp9833	ext computer networks & appl
    comp9844	ext neural nets, deep learning
    comp9900	info tech project
    comp9901	p/t res. thesis comp sci & eng
    comp9902	res. thesis comp sci & eng f/t
    comp9910	mgt&com skills-compsci&eng res
    comp9912	project (24 uoc)
    comp9930	readings in comp sci and eng
    comp9945	research project
    comp9991	research project a
    comp9992	research project b
    comp9993	research project c
    crim3010	comparative criminal justice
    cven1015	computing
    cven1025	computing
    cven2002	engineering computations
    cven2025	engineering computations 1
    cven2702	engineering computations
    cven3025	engineering computations 2
    cven4307	steel & composite structures
    cven8827	composite steel-concrete struc
    cven9820	computational struct mechanics
    cven9822	steel & composite structures
    cven9827	composite steel-concrete struc
    danc2000	dance analysis & composition 1
    danc2005	dance analysis & composition 2
    danc2015	dance analysis & composition 3
    dpst1092	computer systems fundamentals
    econ3213	comparative forecasting techs
    econ5122	compet. in the know. econ.
    econ5255	computational stats & econ mod
    edst1492	computer skills for teachers
    edst4092	computer skills for teachers
    edst4157	computing studies method 1
    edst4158	computing studies method 2
    elec4343	source coding & compression
    elec4432	computer control & instrumenta
    elec4605	quantum devices and computers
    elec4632	computer control systems
    elec9401	computer control systems 1
    elec9402	computer control systems 2
    elec9403	real time computing & control
    elec9733	real computing and control
    engg1811	computing for engineers
    euro2302	the messiah complex
    fins3649	compliance & regulatory tech
    fins5549	regtech and compliance
    fins5553	insur. comp. oper. & manage.
    fndn0301	computing studies
    fndn0302	computing studies and research
    fndn0303	computing for design
    fndn0304	computing for academic purpose
    fndn0305	computing for acad purpose h
    fndn0306	computing for acad purposes s
    fndn0311	computing studies - t
    fndn0312	computing academic purpose - t
    fndn0314	computing for design - t
    fndn0315	computing for acad purpose th
    fndn0316	computing for acad purp - ts
    food4220	computer applications
    food4320	computer applications
    food4537	computing in food science
    food9101	complex fluid micro & rheology
    gbat9131	leadership in a complex enviro
    gend1212	analysing a picture:comp.&des.
    gend4201	design and computing
    gene8001	computer game design
    genm0515	computers for professionals
    genp0515	computers for professionals
    gens2001	the computer
    gens5525	the comp: its impact, sign'fcnce
    gent0407	tv soaps: a comparative study
    gent0603	the computer: impact, significan
    gent0802	the complexity of everyday life
    gent1003	computers into the 21st c
    geog3161	computer mapping & data displa
    geog3861	computer mapping
    geog9014	computer mapping &data display
    geog9210	computer mapping & data displa
    geol0300	computing & stats for geol
    geol2041	geological computing
    gmat1111	introduction to computing
    gmat1150	survey methods& computations
    gmat1300	comp appl in geomatics
    gmat2111	principles of computer processin
    gmat2112	principles of computer processin
    gmat2122	computer graphics 1
    gmat2131	survey computations
    gmat2350	comp for spatial info sciences
    gmat2500	surveying computations a
    gmat2550	surveying computations b
    gmat3111	survey computations
    gmat3122	computer graphics 1
    gmat3231	geodetic computations
    gmat4111	data analysis & computing 1
    gmat4112	data analysis & computing 1
    gmat5111	data analysis & computing 2
    gmat5112	data analysis & computing 2
    gmat5122	computer graphics 2
    hdat9300	computing 4 hdat
    heal9471	comparative h'lth care systems
    heal9501	comp tech for health serv mngt
    hist2487	the messiah complex
    hpsc2610	computers, brains & minds
    hpst2004	computers, brains & minds
    hpst2109	computers, brains & minds
    ides2121	introduction to computing
    ides3101	design studio 5: complexity
    ides3231	adv computer aided product des
    ides5153	computer graphic applications
    ides5154	computer aided design
    iest5009	competencies in sustainability
    iest5010	competencies in sustainability
    ilas0232	computer prog'mng for info. appl
    ilas0233	computing applications in the in
    infs3607	distributed computer systems
    infs4858	managing complex projects
    infs5848	managing complex projects
    inta1001	interior arch composition 1
    inta1002	interior arch composition 2
    inta1003	interior arch composition 3
    irob5732	spec topic- internat & comp ir
    irob5734	adv seminar-internat & comp ir
    jurd7348	harry gibbs moot comp 6uoc
    jurd7419	competition law and policy
    jurd7468	aust legal system comp perspec
    jurd7473	asian competition law
    jurd7474	competition law and ip
    jurd7489	complex civil litigation
    jurd7522	competition law
    jurd7559	int'l&comparative law w'shop
    jurd7603	global issues in comp policy
    jurd7610	mediation competition
    jurd7616	international & comparative ip
    jurd7989	comparative anti-terrorism law
    jwst2104	the messiah complex
    land1131	introduction to computer applica
    laws1032	computer applications to law
    laws2065	comparative law
    laws2085	comparative law
    laws2110	comparative constitutional law
    laws2148	harry gibbs moot comp 8uoc
    laws2410	mediation competition
    laws2589	complex civil litigation
    laws3009	comparative criminal justice:
    laws3022	competition law
    laws3035	developing comp apps to law
    laws3051	telecomm. competition & cons.
    laws3148	harry gibbs moot comp
    laws3159	int'l&comparative law w'shop
    laws3368	aust legal system comp perspec
    laws3510	mediation competition
    laws3589	complex civil litigation
    laws4016	international & comparative ip
    laws4019	competition law
    laws4089	comparative anti-terrorism law
    laws4120	themes in asian & compar. law
    laws4133	issues in asian & comp law
    laws4291	comparative constitutional law
    laws4620	computer applications to law
    laws4765	complex commercial litigation
    laws5234	competition law and regulation
    laws7003	global issues in comp policy
    laws8016	international & comparative ip
    laws8073	asian competition law
    laws8074	competition law and ip
    laws8118	legal systems in comp persp
    laws8143	comparative patent law
    laws8144	comparative trade mark law
    laws8168	aust legal system comp perspec
    laws8203	global issues in comp policy
    laws8219	competition law and policy
    laws8289	comparative anti-terrorism law
    laws8765	complex commercial litigation
    laws9973	comparative law
    laws9984	int. & comp. indigenous law
    legt5531	comp. bus. & legal strategies
    legt5602	tax admin. & compliance
    libs0233	computer applications in the inf
    manf3500	computers in manufacturing 1
    manf4500	computers in manufacturing 2
    manf4601	comp aided production mgmt a
    manf4602	comp aided production mgmt b
    manf8560	computer integrated manufact.
    manf9500	computer-aided progrmg for numcl
    manf9543	comp aided design/manufacture
    manf9560	computer integrated manufact.
    mark3022	computer applications in marketi
    math1061	introductory applied computing
    math2301	mathematical computing
    math2430	symbolic computing
    math2520	complex analysis
    math2521	complex analysis
    math2620	higher complex analysis
    math2621	higher complex analysis
    math2810	statistical computing
    math2910	higher statistical computing
    math3101	computational mathematics
    math3301	advanced math computing
    math3311	comp mathematics for finance
    math3400	logic & computability
    math3421	logic and computability
    math3430	symbolic computing
    math3680	higher complex analysis
    math3790	higher computat. combinatorics
    math3800	statistical computation 1
    math3810	statistical computation 2
    math3821	stat modelling & computing
    math3871	bayesian inference and comp
    math4003	maths and comp sci honours f/t
    math4004	maths and comp sci honours p/t
    math5009	comp'l coursework thesis ft
    math5010	comp'l coursework thesis pt
    math5305	computational mathematics
    math5315	high perf numerical computing
    math5335	comp mathematics for finance
    math5400	logic & computability
    math5505	computational combinatorics
    math5685	complex analysis
    math5856	intro to stats and stat comput
    math5960	bayesian inference & comput'n
    math9315	topics in mathematical computing
    mats1021	computing in materials science
    mats1264	fibre reinforced plastic composi
    mats3064	composite materials
    mats4005	composites and functional mats
    mats5342	comp modelling & design
    mats6110	computational materials
    mech1500	computing 1m
    mech3500	computing 2m
    mech3510	computing applications in mech.
    mech3530	computing applcts in mechanical
    mech3540	computational engineering
    mech4130	computer-aided engineering desig
    mech4150	design & maintenance of componen
    mech4500	computing 3m
    mech4620	computational fluid dynamics
    mech8620	computational fluid dynamics
    mech9150	design & maintenance of componen
    mech9420	composite materials and mechan
    mech9620	computational fluid dynamics
    meft5103	computer media
    mgmt2106	comparative management systems
    mgmt5802	comp. adv. through people
    mine0710	computing 1
    mine1720	microcomputers (mining)
    mine1730	computer applications in mining
    mine4082	computational methods
    mine4810	comp methods in geomechanics
    mngt6584	complex adaptive leadership
    mtrn2500	comp for mtrn
    mtrn3500	comp appl in mechatonic sys
    mtrn3530	computing applcts in mech.sys.
    pfst2000	dance analysis & composition 1
    pfst2005	dance analysis & composition 2
    pfst2011	performance composition
    phcm9471	comparative h'lth care systems
    phil5206	ai & computer science
    phil5207	ai & computer science 2a
    phys1601	comp. applic'ns in exp. sci. 1
    phys2001	mechanics & computational phys
    phys2020	computational physics
    phys2120	mechanics and computational
    phys2601	computer applications 2
    phys3601	computer applications in instrum
    phys3610	computational physics
    phys3620	computer based signal processing
    plan1061	computer literacy
    pols2016	concepts in comparative pol cult
    pols3953	comparative politics: russia
    psyc3191	computer science & psychology
    ptrl1013	computing-petroleum engineers
    ptrl4013	well completion & stimulation
    ptrl5016	well completions & stimulation
    ptrl6016	well completions & stimulation
    regs0044	comp law in global context
    regs0115	compliance: financial service
    regs0218	compliance: financial services
    regs0428	computer applications in linguis
    regs0453	multiple regress. & stat comp
    regs0474	comparative international tax
    regs0633	comparative corp & comm law
    regs0638	international comparative corp
    regs0718	energy co-compliance in bldgs
    regs3092	comp cntrl of machines & proc
    regs3265	intl and comparative ind. rel.
    regs3410	computer networks
    regs3873	introduction to computer graphic
    regs3909	trade marks & unfair comp
    regs3948	competition law
    regs4045	competition reg. of mergers
    regs5618	comp integrated manufacturing
    regs7726	composites & multiphase polyme
    regs7908	service managing for comp.adv.
    sart1608	digital composite 1
    sart1681	multimedia computing elective1
    sart1810	introduction to computing
    sart2608	digital composite 2
    sart2681	multimedia computing elective2
    sart2811	multimedia computing workshop
    sart2835	composition and design
    sart3608	digital composite 3
    sart3681	multimedia computing elective3
    sart3840	advanced multimedia computing
    sart9725	intro to multimedia computing
    sart9739	multimedia computing elective
    sart9741	composition and design
    sdes1106	design and computers 1
    sdes1110	design and computers 2
    sdes1111	integrated design computing 1
    sdes1211	integrated design computing 2
    sdes1601	colour,composition &typography
    sdes2107	design and computers 3
    sdes2115	design and computers 2b
    sdes3107	design and computers 4
    sdes3173	advanced computer graphics
    sdes4103	design and computers 4
    sdes6714	intro 3d computer aided design
    slsp2902	computers and comm.
    soca3314	the messiah complex
    soci3401	computer analysis of social data
    soci3408	computer analysis of social data
    soma1608	digital composite
    soma1681	intro multimedia computing
    soma1810	introduction to computing
    soma2402	tangible computing
    soma2608	digital composite 2
    soma2681	advanced multimedia computing
    soma2811	multimedia computing workshop
    soma3415	compositional project
    soma3608	digital composite 3
    surv1111	introduction to computing
    surv2111	principles of computer processin
    surv2122	computer graphics 1
    surv3111	survey computations
    surv3231	geodetic computations
    surv4111	data analysis & computing 1
    surv5111	data analysis & computing 2
    surv5122	computer graphics 2
    surv6121	computer graphics
    tabl1002	computer information systems
    tabl2053	acct for complex struct & inst
    tabl2731	competition and consumer law
    tabl3044	comparative tax systems
    tabl5544	comparative tax systems
    tabl5545	principles of reg, comp&enfor
    tabl5546	intro to regtech in comp&enfor
    tabl5547	building effec. comp. sys
    tedg1101	computers in education
    tedg1106	computer-based resources: design
    tedg1107	managing with computers in schoo
    tedg1112	computers - gifted & talented st
    tedg1113	computer control technology in e
    teed1134	fundamentals of computing
    teed2119	computers & people
    tele4343	source coding and compression
    tele9302	computer networks
    text2501	computing applications
    ymed3006	comparative health systems
    zacm3011	component design
    zacm3433	compressible flow
    zacm4020	computational structures
    zacm4031	compressible flow
    zacm4913	eng app of comp fluid dynamics
    zbus2200	markets and competition
    zeit1101	computational problem solving
    zeit1110	computer games
    zeit2102	computer technology
    zeit2104	computers and security
    zeit2305	computer games
    zeit3113	computer languages & algorithm
    zeit3304	computing proj - info sys
    zeit3307	computer games
    zeit4003	computational fluid dynamics
    zeit7101	computational problem solving
    zeit8020	computer network operations
    zeit9100	computer science research f/t
    zeit9101	computer science research p/t
    zgen2300	computers in society
    zgen2301	computer games
    zhss8431	comparative defence planning
    zint1001	eng comp methods 1
    zite1001	computer tools for engineers
    zite1101	intro to computer science
    zite2101	computer languages & algorithm
    zite2102	computer technology
    zite3101	computing proj - comp sci
    zite3105	human computer interaction
    zite3106	interactive computer graphics
    zite3113	computer languages & algorithm
    zite3211	microcomputer interfacing
    zite3304	computing proj - info sys
    zite4101	computer sci 4 (comb hons) f/t
    zite4102	computer sci 4 (comb hon) p/t
    zite4103	computer science 4 (hons) f/t
    zite4104	computer science 4 (hons) p/t
    zite8103	computer graphics
    zite8104	computer security
    zite8105	computer speech processing
    zite8145	softcomp
    zite9100	computer science research f/t
    zite9101	computer science research p/t
    zpem3302	complex variables
    
    grep -E -i comp course_codes
    ACIV2518	Eng Computational Methods 1
    ACSC1600	Computer Science 1
    ACSC1800	Computer Science 1E
    ACSC2015	Interactive Computer Graphics
    ACSC2020	Computer Science Core B2
    ACSC2021	Computer Systems Architectrue 2
    ACSC2107	Computer Languages B
    ACSC2601	Computer Science 2A
    ACSC2602	Computer Science 2B
    ACSC2802	Computer Science 2EE
    ACSC3003	Computer Project
    ACSC3029	Computing Project 3
    ACSC3030	Cryptography & Computer Securi
    ACSC3601	Computer Science 3A
    ACSC3603	Computer Science 3C
    ACSC4191	Computer Science 4 (Hons) F/T
    ACSC7304	Computer Graphics
    ACSC7306	Computer Speech Processing
    ACSC7336	Computer Security
    ACSC8248	Computer Graphics (12 Cpt)
    ACSC9000	Computer Science Research F/T
    ACSC9001	Computer Science Research P/T
    AELE2007	Computer Design
    AELE2508	Microcomputer Interfacing
    AELE3031	Microcomputer Interfacing
    AELE4511	Computer Control Theory
    AMAT3107	Complex Variables
    AMAT3401	Complex Analysis 3E
    AMAT3503	Complex Variables E
    AMEC3512	Pumps, Turbines & Compressors
    ANCE8001	Computational Mathematics
    ANCE8002	Supercomputing Techniques
    ANCE9105	Comp Techniques Fluid Dynamics
    APHY3028	Computational Physics
    ARCH1391	Digital Computation Studio
    ARCH5202	Computer Applications 2
    ARCH5203	Computer Applications 3
    ARCH5205	Theory of Architectural Computin
    ARCH5220	Computer Graphics Programming 1
    ARCH5221	Computer Graphics Programming 2
    ARCH5223	Computer Applications 2
    ARCH5940	Theory of Architectural Computin
    ARCH5942	Arctitectural Computing Seminar
    ARCH5943	Theory of Architectural Computin
    ARCH6201	Architectural Computing 1
    ARCH6205	Architectural Computing 2
    ARCH6214	Architectural Computing 2
    ARCH7204	Design Computing Theory
    ARCH7205	Computer Graphics Programming
    ARTS2301	Computers, Brains & Minds
    ATAX0002	Computer Information Systems
    ATAX0053	Acct for Complex Struct & Inst
    ATAX0324	GST: Complex Issues & Planning
    ATAX0341	Comparative Tax Systems
    ATAX0424	GST: Complex Issues & Planning
    ATAX0441	Comparative Tax Systems
    ATAX0524	GST: Complex Issues & Planning
    ATAX0641	Comparative Tax Systems
    AUST2003	Aborig. Studies: a Global Compar
    AVEN1500	Computing for Aviation
    BEIL0003	BE Annual Design Competition
    BEIL0004	Design Competitions and Bids
    BENV1141	Computers and Information Tech
    BENV1242	Computer-Aided Design
    BENV2405	Computer Graphics Programming
    BENV7503	Geocomputation
    BINF3020	Computational Bioinformatics
    BINF9020	Computational Bioinformatics
    BIOM5912	Comp Thesis B&C
    BIOM5920	Thesis Part A (Comp)
    BIOM5921	Thesis Part B (Comp)
    BIOM9332	Biocompatibility
    BIOM9501	Computing for Biomedical Eng
    BIOM9601	Biomed Applic.of Microcomp 1
    BIOM9602	Biomed Applic.of Microcomp 2
    BIOS3021	Comparative Animal Physiology
    BLDG2281	Introduction To Computing
    BLDG3282	Computer Apps in Building
    BLDG3482	Computer Aplications in Constr
    CEIC5310	Computing Studies in The Process
    CEIC6711	Complex Fluids
    CEIC8310	Computing Studies Proc Ind
    CEIC8335	Adv Computer Methods
    CHEM3031	Inorg Chem:Trans Metals & Comp
    CHEM3640	Computers in Chemistry
    CIVL1015	Computing
    CIVL1106	Computing & Graphics
    CIVL3015	Engineering Computations
    CIVL3106	Engineering Computations
    CMED9517	Adv Biostatistic & Stat Comp
    CODE1110	Computational Design Theory 1
    CODE1150	Computational Design I
    CODE1210	Computational Design Theory 2
    CODE2110	Computational Design Theory 3
    CODE2121	Advanced Computational Design
    CODE2132	Computational Design Studio IV
    COFA2682	Multi-media Computing Unit 3
    COFA3681	Multi-media Computing Elective 1
    COFA5116	Design & Computers
    COFA5130	Typography & Composition
    COFA5216	Design & Computers 1
    COFA5240	Design & Computers 2 Cad
    COFA5241	Design & Computers 2 Graphics
    COFA5338	Design & Computers 3 - Cad
    COFA5339	Design & Computers 3 - Graphic
    COFA8670	Intro To Multi-media Computing
    COMD2040	Of Tigers & Pussycats: a Compa
    COMP0011	Fundamentals of Computing
    COMP1000	Web, Spreadsheets & Databases
    COMP1001	Introduction to Computing
    COMP1010	The Art of Computing
    COMP1011	Computing 1A
    COMP1021	Computing 1B
    COMP1081	Harnessing the Power of IT
    COMP1091	Solving Problems with Software
    COMP1400	Programming for Designers
    COMP1511	Programming Fundamentals
    COMP1521	Computer Systems Fundamentals
    COMP1531	Software Eng Fundamentals
    COMP1711	Higher Computing 1A
    COMP1721	Higher Computing 1B
    COMP1911	Computing 1A
    COMP1917	Computing 1
    COMP1921	Computing 1B
    COMP1927	Computing 2
    COMP2011	Data Organisation
    COMP2021	Digital System Structures
    COMP2041	Software Construction
    COMP2091	Computing 2
    COMP2110	Software System Specification
    COMP2111	System Modelling and Design
    COMP2121	Microprocessors & Interfacing
    COMP2411	Logic and Logic Programming
    COMP2511	O-O Design & Programming
    COMP2521	Data Structures and Algorithms
    COMP2711	Higher Data Organisation
    COMP2811	Computing B
    COMP2911	Eng. Design in Computing
    COMP2920	Professional Issues and Ethics
    COMP3111	Software Engineering
    COMP3120	Introduction to Algorithms
    COMP3121	Algorithms & Programming Tech
    COMP3131	Programming Languages & Compil
    COMP3141	Software Sys Des&Implementat'n
    COMP3151	Foundations of Concurrency
    COMP3152	Comparative Concurrency Semant
    COMP3153	Algorithmic Verification
    COMP3161	Concepts of Programming Lang.
    COMP3171	Object-Oriented Programming
    COMP3211	Computer Architecture
    COMP3221	Microprocessors & Embedded Sys
    COMP3222	Digital Circuits and Systems
    COMP3231	Operating Systems
    COMP3241	Real Time Systems
    COMP3311	Database Systems
    COMP3331	Computer Networks&Applications
    COMP3411	Artificial Intelligence
    COMP3421	Computer Graphics
    COMP3431	Robotic Software Architecture
    COMP3441	Security Engineering
    COMP3511	Human Computer Interaction
    COMP3601	Design Project A
    COMP3710	Software Project Management
    COMP3711	Software Project Management
    COMP3720	Total Quality Management
    COMP3821	Ext Algorithms&Prog Techniques
    COMP3881	Ext Digital Circuits & Systems
    COMP3891	Ext Operating Systems
    COMP3900	Computer Science Project
    COMP3901	Special Project A
    COMP3902	Special Project B
    COMP3931	Ext Computer Networks & App
    COMP4001	Object-Oriented Software Dev
    COMP4002	Logic Synthesis & Verification
    COMP4003	Industrial Software Developmen
    COMP4011	Web Applications Engineering
    COMP4012	Occasional Elec S2 - Comp.Eng.
    COMP4121	Advanced & Parallel Algorithms
    COMP4128	Programming Challenges
    COMP4131	Programming Language Semantics
    COMP4132	Adv. Functional Programming
    COMP4133	Advanced Compiler Construction
    COMP4141	Theory of Computation
    COMP4151	Algorithmic Verification
    COMP4161	Advanced Verification
    COMP4181	Language-based Software Safety
    COMP4211	Adv Architectures & Algorithms
    COMP4314	Next Generation Database Systs
    COMP4317	XML and Databases
    COMP4335	Wireless Mesh&Sensor Networks
    COMP4336	Mobile Data Networking
    COMP4337	Securing Fixed & Wireless Netw
    COMP4411	Experimental Robotics
    COMP4412	Introduction to Modal Logic
    COMP4415	First-order Logic
    COMP4416	Intelligent Agents
    COMP4418	Knowledge Representation
    COMP4431	Game Design Workshop
    COMP4432	Game Design Studio
    COMP4442	Advanced Computer Security
    COMP4511	User Interface Design & Constr
    COMP4601	Design Project B
    COMP4903	Industrial Training
    COMP4904	Industrial Training 1
    COMP4905	Industrial Training 2
    COMP4906	Industrial Training 3
    COMP4910	Thesis Part A
    COMP4911	Thesis Part B
    COMP4913	Computer Science 4 Honours P/T
    COMP4914	Computer Science 4 Honours F/T
    COMP4920	Management and Ethics
    COMP4930	Thesis Part A
    COMP4931	Thesis Part B
    COMP4941	Thesis Part B
    COMP4951	Research Thesis A
    COMP4952	Research Thesis B
    COMP4953	Research Thesis C
    COMP4961	Computer Science Thesis A
    COMP4962	Computer Science Thesis B
    COMP4963	Computer Science Thesis C
    COMP6080	Web Front-End Programming
    COMP6324	IoT Services Engineering
    COMP6441	Security Engineering
    COMP6443	Web Application Security
    COMP6445	Digital Forensics
    COMP6447	Security Assessment
    COMP6448	Security Masterclass
    COMP6451	Cryptocurrency and DLT
    COMP6452	Blockchain App Architecture
    COMP6714	Info Retrieval and Web Search
    COMP6721	(In-)Formal Methods
    COMP6731	Combinatorial Data Processing
    COMP6733	Internet of Things
    COMP6741	Parameterized & Exact Comp.
    COMP6752	Modelling Concurrent Systems
    COMP6771	Advanced C++ Programming
    COMP6841	Extended Security Engineering
    COMP6843	Extended WebApp Security
    COMP6845	Extended Digital Forensics
    COMP9000	Special Program
    COMP9001	E-Commerce Technologies
    COMP9008	Software Engineering
    COMP9009	Adv Topics in Software Eng
    COMP9015	Issues in Computing
    COMP9018	Advanced Graphics
    COMP9020	Foundations of Comp. Science
    COMP9021	Principles of Programming
    COMP9022	Digital Systems Structures
    COMP9024	Data Structures & Algorithms
    COMP9031	Internet Programming
    COMP9032	Microprocessors & Interfacing
    COMP9041	Software Construction
    COMP9044	Software Construction
    COMP9081	Harnessing the Power of IT
    COMP9101	Design &Analysis of Algorithms
    COMP9102	Programming Lang & Compilers
    COMP9103	Algorithms & Comp. Complexity
    COMP9104	Quantum ICT
    COMP9116	S'ware Dev: B-Meth & B-Toolkit
    COMP9117	Software Architecture
    COMP9151	Foundations of Concurrency
    COMP9152	Comparative Concurrency Semant
    COMP9153	Algorithmic Verification
    COMP9154	Foundations of Concurrency
    COMP9161	Concepts of Programming Lang.
    COMP9164	Concepts of Programming Lang.
    COMP9171	Object-Oriented Programming
    COMP9181	Language-based Software Safety
    COMP9201	Operating Systems
    COMP9211	Computer Architecture
    COMP9221	Microprocessors & Embedded Sys
    COMP9222	Digital Circuits and Systems
    COMP9231	Integrated Digital Systems
    COMP9242	Advanced Operating Systems
    COMP9243	Distributed Systems
    COMP9244	Software View of Proc Architec
    COMP9245	Real-Time Systems
    COMP9282	Ext Micros & Interfacing
    COMP9283	Ext Operating Systems
    COMP9301	Cyber Security Project
    COMP9302	Cyber Security Project B
    COMP9311	Database Systems
    COMP9312	Data Analytics for Graphs
    COMP9313	Big Data Management
    COMP9314	Next Generation Database Systs
    COMP9315	Database Systems Implementat'n
    COMP9316	eCommerce Implementation
    COMP9317	XML and Databases
    COMP9318	Data Warehousing & Data Mining
    COMP9319	Web Data Compression & Search
    COMP9321	Data Services Engineering
    COMP9322	Software Service Design & Eng
    COMP9323	e-Enterprise Project
    COMP9331	Computer Networks&Applications
    COMP9332	Network Routing and Switching
    COMP9333	Advanced Computer Networks
    COMP9334	Systems Capacity Planning
    COMP9335	Wireless Mesh&Sensor Networks
    COMP9336	Mobile Data Networking
    COMP9337	Securing Fixed & Wireless Netw
    COMP9414	Artificial Intelligence
    COMP9415	Computer Graphics
    COMP9416	Knowledge Based Systems
    COMP9417	Machine Learning & Data Mining
    COMP9418	Advanced Machine Learning
    COMP9431	Robotic Software Architecture
    COMP9433	Comp. Methods for Robotics
    COMP9434	Robotic Software Architecture
    COMP9441	Security Engineering
    COMP9444	Neural Networks, Deep Learning
    COMP9447	Security Engineering Workshop
    COMP9491	Applied AI
    COMP9511	Human Computer Interaction
    COMP9514	Advanced Decision Theory
    COMP9515	Pattern Classification
    COMP9517	Computer Vision
    COMP9518	Pattern Recognition
    COMP9519	Multimedia Systems
    COMP9520	Ext Foundations of Computer Sc
    COMP9596	Research Project
    COMP9790	Principles of GNSS Positioning
    COMP9791	Modern Navigation &Positioning
    COMP9801	Ext Design&Analysis of Algo
    COMP9814	Ext Artificial Intelligence
    COMP9833	Ext Computer Networks & Appl
    COMP9844	Ext Neural Nets, Deep Learning
    COMP9900	Info Tech Project
    COMP9901	P/T Res. Thesis Comp Sci & Eng
    COMP9902	Res. Thesis Comp Sci & Eng F/T
    COMP9910	Mgt&Com Skills-CompSci&Eng Res
    COMP9912	Project (24 UOC)
    COMP9930	Readings in Comp Sci and Eng
    COMP9945	Research Project
    COMP9991	Research Project A
    COMP9992	Research Project B
    COMP9993	Research Project C
    CRIM3010	Comparative Criminal Justice
    CVEN1015	Computing
    CVEN1025	Computing
    CVEN2002	Engineering Computations
    CVEN2025	Engineering Computations 1
    CVEN2702	Engineering Computations
    CVEN3025	Engineering Computations 2
    CVEN4307	Steel & Composite Structures
    CVEN8827	Composite Steel-Concrete Struc
    CVEN9820	Computational Struct Mechanics
    CVEN9822	Steel & Composite Structures
    CVEN9827	Composite Steel-Concrete Struc
    DANC2000	Dance Analysis & Composition 1
    DANC2005	Dance Analysis & Composition 2
    DANC2015	Dance Analysis & Composition 3
    DPST1092	Computer Systems Fundamentals
    ECON3213	Comparative Forecasting Techs
    ECON5122	Compet. in the Know. Econ.
    ECON5255	Computational Stats & Econ Mod
    EDST1492	Computer Skills for Teachers
    EDST4092	Computer Skills for Teachers
    EDST4157	Computing Studies Method 1
    EDST4158	Computing Studies Method 2
    ELEC4343	Source Coding & Compression
    ELEC4432	Computer Control & Instrumenta
    ELEC4605	Quantum Devices and Computers
    ELEC4632	Computer Control Systems
    ELEC9401	Computer Control Systems 1
    ELEC9402	Computer Control Systems 2
    ELEC9403	Real Time Computing & Control
    ELEC9733	Real Computing and Control
    ENGG1811	Computing for Engineers
    EURO2302	The Messiah Complex
    FINS3649	Compliance & Regulatory Tech
    FINS5549	RegTech and Compliance
    FINS5553	Insur. Comp. Oper. & Manage.
    FNDN0301	Computing Studies
    FNDN0302	Computing Studies and Research
    FNDN0303	Computing for Design
    FNDN0304	Computing for Academic Purpose
    FNDN0305	Computing for Acad Purpose H
    FNDN0306	Computing for Acad Purposes S
    FNDN0311	Computing Studies - T
    FNDN0312	Computing Academic Purpose - T
    FNDN0314	Computing for Design - T
    FNDN0315	Computing for Acad Purpose TH
    FNDN0316	Computing for Acad Purp - TS
    FOOD4220	Computer Applications
    FOOD4320	Computer Applications
    FOOD4537	Computing in Food Science
    FOOD9101	Complex Fluid Micro & Rheology
    GBAT9131	Leadership in a Complex Enviro
    GEND1212	Analysing a Picture:Comp.&Des.
    GEND4201	Design and Computing
    GENE8001	Computer Game Design
    GENM0515	Computers for Professionals
    GENP0515	Computers for Professionals
    GENS2001	The Computer
    GENS5525	The Comp: Its Impact, Sign'fcnce
    GENT0407	Tv Soaps: a Comparative Study
    GENT0603	The Computer: Impact, Significan
    GENT0802	The Complexity of Everyday Life
    GENT1003	Computers into the 21st C
    GEOG3161	Computer Mapping & Data Displa
    GEOG3861	Computer Mapping
    GEOG9014	Computer Mapping &Data Display
    GEOG9210	Computer Mapping & Data Displa
    GEOL0300	Computing & Stats for Geol
    GEOL2041	Geological Computing
    GMAT1111	Introduction To Computing
    GMAT1150	Survey Methods& Computations
    GMAT1300	Comp Appl in Geomatics
    GMAT2111	Principles of Computer Processin
    GMAT2112	Principles of Computer Processin
    GMAT2122	Computer Graphics 1
    GMAT2131	Survey Computations
    GMAT2350	Comp for Spatial Info Sciences
    GMAT2500	Surveying Computations A
    GMAT2550	Surveying Computations B
    GMAT3111	Survey Computations
    GMAT3122	Computer Graphics 1
    GMAT3231	Geodetic Computations
    GMAT4111	Data Analysis & Computing 1
    GMAT4112	Data Analysis & Computing 1
    GMAT5111	Data Analysis & Computing 2
    GMAT5112	Data Analysis & Computing 2
    GMAT5122	Computer Graphics 2
    HDAT9300	Computing 4 HDAT
    HEAL9471	Comparative H'lth Care Systems
    HEAL9501	Comp Tech for Health Serv Mngt
    HIST2487	The Messiah Complex
    HPSC2610	Computers, Brains & Minds
    HPST2004	Computers, Brains & Minds
    HPST2109	Computers, Brains & Minds
    IDES2121	Introduction To Computing
    IDES3101	Design Studio 5: Complexity
    IDES3231	Adv Computer Aided Product Des
    IDES5153	Computer Graphic Applications
    IDES5154	Computer Aided Design
    IEST5009	Competencies in Sustainability
    IEST5010	Competencies in Sustainability
    ILAS0232	Computer Prog'mng for Info. Appl
    ILAS0233	Computing Applications in The in
    INFS3607	Distributed Computer Systems
    INFS4858	Managing Complex Projects
    INFS5848	Managing Complex Projects
    INTA1001	Interior Arch Composition 1
    INTA1002	Interior Arch Composition 2
    INTA1003	Interior Arch Composition 3
    IROB5732	Spec Topic- Internat & Comp IR
    IROB5734	Adv Seminar-Internat & Comp IR
    JURD7348	Harry Gibbs Moot Comp 6uoc
    JURD7419	Competition Law and Policy
    JURD7468	Aust Legal System Comp Perspec
    JURD7473	Asian Competition Law
    JURD7474	Competition Law and IP
    JURD7489	Complex Civil Litigation
    JURD7522	Competition Law
    JURD7559	Int'l&Comparative Law W'shop
    JURD7603	Global Issues in Comp Policy
    JURD7610	Mediation Competition
    JURD7616	International & Comparative IP
    JURD7989	Comparative Anti-Terrorism Law
    JWST2104	The Messiah Complex
    LAND1131	Introduction To Computer Applica
    LAWS1032	Computer Applications to Law
    LAWS2065	Comparative Law
    LAWS2085	Comparative Law
    LAWS2110	Comparative Constitutional Law
    LAWS2148	Harry Gibbs Moot Comp 8uoc
    LAWS2410	Mediation Competition
    LAWS2589	Complex Civil Litigation
    LAWS3009	Comparative Criminal Justice:
    LAWS3022	Competition Law
    LAWS3035	Developing Comp Apps to Law
    LAWS3051	Telecomm. Competition & Cons.
    LAWS3148	Harry Gibbs Moot Comp
    LAWS3159	Int'l&Comparative Law W'shop
    LAWS3368	Aust Legal System Comp Perspec
    LAWS3510	Mediation Competition
    LAWS3589	Complex Civil Litigation
    LAWS4016	International & Comparative IP
    LAWS4019	Competition Law
    LAWS4089	Comparative Anti-Terrorism Law
    LAWS4120	Themes in Asian & Compar. Law
    LAWS4133	Issues in Asian & Comp Law
    LAWS4291	Comparative Constitutional Law
    LAWS4620	Computer Applications To Law
    LAWS4765	Complex Commercial Litigation
    LAWS5234	Competition Law and Regulation
    LAWS7003	Global Issues in Comp Policy
    LAWS8016	International & Comparative IP
    LAWS8073	Asian Competition Law
    LAWS8074	Competition Law and IP
    LAWS8118	Legal Systems in Comp Persp
    LAWS8143	Comparative Patent Law
    LAWS8144	Comparative Trade Mark Law
    LAWS8168	Aust Legal System Comp Perspec
    LAWS8203	Global Issues in Comp Policy
    LAWS8219	Competition Law and Policy
    LAWS8289	Comparative Anti-Terrorism Law
    LAWS8765	Complex Commercial Litigation
    LAWS9973	Comparative Law
    LAWS9984	Int. & Comp. Indigenous Law
    LEGT5531	Comp. Bus. & Legal Strategies
    LEGT5602	Tax Admin. & Compliance
    LIBS0233	Computer Applications in The Inf
    MANF3500	Computers in Manufacturing 1
    MANF4500	Computers in Manufacturing 2
    MANF4601	Comp Aided Production Mgmt A
    MANF4602	Comp Aided Production Mgmt B
    MANF8560	Computer Integrated Manufact.
    MANF9500	Computer-aided Progrmg for Numcl
    MANF9543	Comp Aided Design/Manufacture
    MANF9560	Computer Integrated Manufact.
    MARK3022	Computer Applications in Marketi
    MATH1061	Introductory Applied Computing
    MATH2301	Mathematical Computing
    MATH2430	Symbolic Computing
    MATH2520	Complex Analysis
    MATH2521	Complex Analysis
    MATH2620	Higher Complex Analysis
    MATH2621	Higher Complex Analysis
    MATH2810	Statistical Computing
    MATH2910	Higher Statistical Computing
    MATH3101	Computational Mathematics
    MATH3301	Advanced Math Computing
    MATH3311	Comp Mathematics for Finance
    MATH3400	Logic & Computability
    MATH3421	Logic and Computability
    MATH3430	Symbolic Computing
    MATH3680	Higher Complex Analysis
    MATH3790	Higher Computat. Combinatorics
    MATH3800	Statistical Computation 1
    MATH3810	Statistical Computation 2
    MATH3821	Stat Modelling & Computing
    MATH3871	Bayesian Inference and Comp
    MATH4003	Maths and Comp Sci Honours F/T
    MATH4004	Maths and Comp Sci Honours P/T
    MATH5009	Comp'l Coursework Thesis FT
    MATH5010	Comp'l Coursework Thesis PT
    MATH5305	Computational Mathematics
    MATH5315	High Perf Numerical Computing
    MATH5335	Comp Mathematics for Finance
    MATH5400	Logic & Computability
    MATH5505	Computational Combinatorics
    MATH5685	Complex Analysis
    MATH5856	Intro to Stats and Stat Comput
    MATH5960	Bayesian Inference & Comput'n
    MATH9315	Topics in Mathematical Computing
    MATS1021	Computing in Materials Science
    MATS1264	Fibre Reinforced Plastic Composi
    MATS3064	Composite Materials
    MATS4005	Composites and Functional Mats
    MATS5342	Comp Modelling & Design
    MATS6110	Computational Materials
    MECH1500	Computing 1M
    MECH3500	Computing 2M
    MECH3510	Computing Applications in Mech.
    MECH3530	Computing Applcts in Mechanical
    MECH3540	Computational Engineering
    MECH4130	Computer-aided Engineering Desig
    MECH4150	Design & Maintenance of Componen
    MECH4500	Computing 3M
    MECH4620	Computational Fluid Dynamics
    MECH8620	Computational Fluid Dynamics
    MECH9150	Design & Maintenance of Componen
    MECH9420	Composite Materials and Mechan
    MECH9620	Computational Fluid Dynamics
    MEFT5103	Computer Media
    MGMT2106	Comparative Management Systems
    MGMT5802	Comp. Adv. Through People
    MINE0710	Computing 1
    MINE1720	Microcomputers (mining)
    MINE1730	Computer Applications in Mining
    MINE4082	Computational Methods
    MINE4810	Comp Methods in Geomechanics
    MNGT6584	Complex Adaptive Leadership
    MTRN2500	Comp for MTRN
    MTRN3500	Comp Appl in Mechatonic Sys
    MTRN3530	Computing Applcts in Mech.Sys.
    PFST2000	Dance Analysis & Composition 1
    PFST2005	Dance Analysis & Composition 2
    PFST2011	Performance Composition
    PHCM9471	Comparative H'lth Care Systems
    PHIL5206	AI & Computer Science
    PHIL5207	Ai & Computer Science 2A
    PHYS1601	Comp. Applic'ns in Exp. Sci. 1
    PHYS2001	Mechanics & Computational Phys
    PHYS2020	Computational Physics
    PHYS2120	Mechanics and Computational
    PHYS2601	Computer Applications 2
    PHYS3601	Computer Applications in Instrum
    PHYS3610	Computational Physics
    PHYS3620	Computer Based Signal Processing
    PLAN1061	Computer Literacy
    POLS2016	Concepts in Comparative Pol Cult
    POLS3953	Comparative Politics: Russia
    PSYC3191	Computer Science & Psychology
    PTRL1013	Computing-Petroleum Engineers
    PTRL4013	Well Completion & Stimulation
    PTRL5016	Well Completions & Stimulation
    PTRL6016	Well Completions & Stimulation
    REGS0044	Comp Law in Global Context
    REGS0115	Compliance: Financial Service
    REGS0218	Compliance: Financial Services
    REGS0428	Computer Applications in Linguis
    REGS0453	Multiple Regress. & Stat Comp
    REGS0474	Comparative International Tax
    REGS0633	Comparative Corp & Comm Law
    REGS0638	International Comparative Corp
    REGS0718	Energy Co-Compliance in Bldgs
    REGS3092	Comp Cntrl of Machines & Proc
    REGS3265	Intl and Comparative Ind. Rel.
    REGS3410	Computer Networks
    REGS3873	Introduction To Computer Graphic
    REGS3909	Trade Marks & Unfair Comp
    REGS3948	Competition Law
    REGS4045	Competition Reg. of Mergers
    REGS5618	Comp Integrated Manufacturing
    REGS7726	Composites & Multiphase Polyme
    REGS7908	Service Managing for Comp.Adv.
    SART1608	Digital Composite 1
    SART1681	Multimedia Computing Elective1
    SART1810	Introduction to Computing
    SART2608	Digital Composite 2
    SART2681	Multimedia Computing Elective2
    SART2811	Multimedia Computing Workshop
    SART2835	Composition and Design
    SART3608	Digital Composite 3
    SART3681	Multimedia Computing Elective3
    SART3840	Advanced Multimedia Computing
    SART9725	Intro to Multimedia Computing
    SART9739	Multimedia Computing Elective
    SART9741	Composition and Design
    SDES1106	Design and Computers 1
    SDES1110	Design and Computers 2
    SDES1111	Integrated Design Computing 1
    SDES1211	Integrated Design Computing 2
    SDES1601	Colour,Composition &Typography
    SDES2107	Design and Computers 3
    SDES2115	Design and Computers 2B
    SDES3107	Design and Computers 4
    SDES3173	Advanced Computer Graphics
    SDES4103	Design and Computers 4
    SDES6714	Intro 3D Computer Aided Design
    SLSP2902	Computers and Comm.
    SOCA3314	The Messiah Complex
    SOCI3401	Computer Analysis of Social Data
    SOCI3408	Computer Analysis of Social Data
    SOMA1608	Digital Composite
    SOMA1681	Intro Multimedia Computing
    SOMA1810	Introduction to Computing
    SOMA2402	Tangible Computing
    SOMA2608	Digital Composite 2
    SOMA2681	Advanced Multimedia Computing
    SOMA2811	Multimedia Computing Workshop
    SOMA3415	Compositional Project
    SOMA3608	Digital Composite 3
    SURV1111	Introduction To Computing
    SURV2111	Principles of Computer Processin
    SURV2122	Computer Graphics 1
    SURV3111	Survey Computations
    SURV3231	Geodetic Computations
    SURV4111	Data Analysis & Computing 1
    SURV5111	Data Analysis & Computing 2
    SURV5122	Computer Graphics 2
    SURV6121	Computer Graphics
    TABL1002	Computer Information Systems
    TABL2053	Acct for Complex Struct & Inst
    TABL2731	Competition and Consumer Law
    TABL3044	Comparative Tax Systems
    TABL5544	Comparative Tax Systems
    TABL5545	Principles of Reg, Comp&Enfor
    TABL5546	Intro to RegTech in Comp&Enfor
    TABL5547	Building Effec. Comp. Sys
    TEDG1101	Computers in Education
    TEDG1106	Computer-based Resources: Design
    TEDG1107	Managing With Computers in Schoo
    TEDG1112	Computers - Gifted & Talented St
    TEDG1113	Computer Control Technology in E
    TEED1134	Fundamentals of Computing
    TEED2119	Computers & People
    TELE4343	Source Coding and Compression
    TELE9302	Computer Networks
    TEXT2501	Computing Applications
    YMED3006	Comparative Health Systems
    ZACM3011	Component Design
    ZACM3433	Compressible Flow
    ZACM4020	Computational Structures
    ZACM4031	Compressible Flow
    ZACM4913	Eng App of Comp Fluid Dynamics
    ZBUS2200	Markets and Competition
    ZEIT1101	Computational Problem Solving
    ZEIT1110	Computer Games
    ZEIT2102	Computer Technology
    ZEIT2104	Computers and Security
    ZEIT2305	Computer Games
    ZEIT3113	Computer Languages & Algorithm
    ZEIT3304	Computing Proj - Info Sys
    ZEIT3307	Computer Games
    ZEIT4003	Computational Fluid Dynamics
    ZEIT7101	Computational Problem Solving
    ZEIT8020	Computer Network Operations
    ZEIT9100	Computer Science Research F/T
    ZEIT9101	Computer Science Research P/T
    ZGEN2300	Computers in Society
    ZGEN2301	Computer Games
    ZHSS8431	Comparative Defence Planning
    ZINT1001	Eng Comp Methods 1
    ZITE1001	Computer Tools for Engineers
    ZITE1101	Intro to Computer Science
    ZITE2101	Computer Languages & Algorithm
    ZITE2102	Computer Technology
    ZITE3101	Computing Proj - Comp Sci
    ZITE3105	Human Computer Interaction
    ZITE3106	Interactive Computer Graphics
    ZITE3113	Computer Languages & Algorithm
    ZITE3211	Microcomputer Interfacing
    ZITE3304	Computing Proj - Info Sys
    ZITE4101	Computer Sci 4 (Comb Hons) F/T
    ZITE4102	Computer Sci 4 (Comb Hon) P/T
    ZITE4103	Computer Science 4 (Hons) F/T
    ZITE4104	Computer Science 4 (Hons) P/T
    ZITE8103	Computer Graphics
    ZITE8104	Computer Security
    ZITE8105	Computer Speech Processing
    ZITE8145	SoftComp
    ZITE9100	Computer Science Research F/T
    ZITE9101	Computer Science Research P/T
    ZPEM3302	Complex Variables
    
    The second one looks better because the data itself isn't transformed, only the internal comparisons.

    If we want to know how many courses have "computing" or "computer" in their title, we have to use grep -E, which recognises the alternative operator "|", and wc to count the number of matches. There are a couple of ways to construct the regexp:

    grep -E -i 'computer|computing' course_codes | wc
        278    1232    9605
    
    grep -E -i 'comput(er|ing)' course_codes | wc
        278    1232    9605
    
    If you don't like the irrelevant word and character counts, use wc -l.

    Most of these 80 matches were CSE offerings, whose course codes begin with COMP, SENG or BINF. Which of the matches were courses offered by other schools?

    Think about it for a moment.... There's no "but not" regexp operator, so instead we construct a composite filter with an extra step to deal with eliminating the CSE courses:

    grep -E -i 'computer|computing' course_codes | grep -E -v '^(COMP|SENG|BINF)'
    ACSC1600	Computer Science 1
    ACSC1800	Computer Science 1E
    ACSC2015	Interactive Computer Graphics
    ACSC2020	Computer Science Core B2
    ACSC2021	Computer Systems Architectrue 2
    ACSC2107	Computer Languages B
    ACSC2601	Computer Science 2A
    ACSC2602	Computer Science 2B
    ACSC2802	Computer Science 2EE
    ACSC3003	Computer Project
    ACSC3029	Computing Project 3
    ACSC3030	Cryptography & Computer Securi
    ACSC3601	Computer Science 3A
    ACSC3603	Computer Science 3C
    ACSC4191	Computer Science 4 (Hons) F/T
    ACSC7304	Computer Graphics
    ACSC7306	Computer Speech Processing
    ACSC7336	Computer Security
    ACSC8248	Computer Graphics (12 Cpt)
    ACSC9000	Computer Science Research F/T
    ACSC9001	Computer Science Research P/T
    AELE2007	Computer Design
    AELE2508	Microcomputer Interfacing
    AELE3031	Microcomputer Interfacing
    AELE4511	Computer Control Theory
    ANCE8002	Supercomputing Techniques
    ARCH5202	Computer Applications 2
    ARCH5203	Computer Applications 3
    ARCH5220	Computer Graphics Programming 1
    ARCH5221	Computer Graphics Programming 2
    ARCH5223	Computer Applications 2
    ARCH5942	Arctitectural Computing Seminar
    ARCH6201	Architectural Computing 1
    ARCH6205	Architectural Computing 2
    ARCH6214	Architectural Computing 2
    ARCH7204	Design Computing Theory
    ARCH7205	Computer Graphics Programming
    ARTS2301	Computers, Brains & Minds
    ATAX0002	Computer Information Systems
    AVEN1500	Computing for Aviation
    BENV1141	Computers and Information Tech
    BENV1242	Computer-Aided Design
    BENV2405	Computer Graphics Programming
    BIOM9501	Computing for Biomedical Eng
    BLDG2281	Introduction To Computing
    BLDG3282	Computer Apps in Building
    BLDG3482	Computer Aplications in Constr
    CEIC5310	Computing Studies in The Process
    CEIC8310	Computing Studies Proc Ind
    CEIC8335	Adv Computer Methods
    CHEM3640	Computers in Chemistry
    CIVL1015	Computing
    CIVL1106	Computing & Graphics
    COFA2682	Multi-media Computing Unit 3
    COFA3681	Multi-media Computing Elective 1
    COFA5116	Design & Computers
    COFA5216	Design & Computers 1
    COFA5240	Design & Computers 2 Cad
    COFA5241	Design & Computers 2 Graphics
    COFA5338	Design & Computers 3 - Cad
    COFA5339	Design & Computers 3 - Graphic
    COFA8670	Intro To Multi-media Computing
    CVEN1015	Computing
    CVEN1025	Computing
    DPST1092	Computer Systems Fundamentals
    EDST1492	Computer Skills for Teachers
    EDST4092	Computer Skills for Teachers
    EDST4157	Computing Studies Method 1
    EDST4158	Computing Studies Method 2
    ELEC4432	Computer Control & Instrumenta
    ELEC4605	Quantum Devices and Computers
    ELEC4632	Computer Control Systems
    ELEC9401	Computer Control Systems 1
    ELEC9402	Computer Control Systems 2
    ELEC9403	Real Time Computing & Control
    ELEC9733	Real Computing and Control
    ENGG1811	Computing for Engineers
    FNDN0301	Computing Studies
    FNDN0302	Computing Studies and Research
    FNDN0303	Computing for Design
    FNDN0304	Computing for Academic Purpose
    FNDN0305	Computing for Acad Purpose H
    FNDN0306	Computing for Acad Purposes S
    FNDN0311	Computing Studies - T
    FNDN0312	Computing Academic Purpose - T
    FNDN0314	Computing for Design - T
    FNDN0315	Computing for Acad Purpose TH
    FNDN0316	Computing for Acad Purp - TS
    FOOD4220	Computer Applications
    FOOD4320	Computer Applications
    FOOD4537	Computing in Food Science
    GEND4201	Design and Computing
    GENE8001	Computer Game Design
    GENM0515	Computers for Professionals
    GENP0515	Computers for Professionals
    GENS2001	The Computer
    GENT0603	The Computer: Impact, Significan
    GENT1003	Computers into the 21st C
    GEOG3161	Computer Mapping & Data Displa
    GEOG3861	Computer Mapping
    GEOG9014	Computer Mapping &Data Display
    GEOG9210	Computer Mapping & Data Displa
    GEOL0300	Computing & Stats for Geol
    GEOL2041	Geological Computing
    GMAT1111	Introduction To Computing
    GMAT2111	Principles of Computer Processin
    GMAT2112	Principles of Computer Processin
    GMAT2122	Computer Graphics 1
    GMAT3122	Computer Graphics 1
    GMAT4111	Data Analysis & Computing 1
    GMAT4112	Data Analysis & Computing 1
    GMAT5111	Data Analysis & Computing 2
    GMAT5112	Data Analysis & Computing 2
    GMAT5122	Computer Graphics 2
    HDAT9300	Computing 4 HDAT
    HPSC2610	Computers, Brains & Minds
    HPST2004	Computers, Brains & Minds
    HPST2109	Computers, Brains & Minds
    IDES2121	Introduction To Computing
    IDES3231	Adv Computer Aided Product Des
    IDES5153	Computer Graphic Applications
    IDES5154	Computer Aided Design
    ILAS0232	Computer Prog'mng for Info. Appl
    ILAS0233	Computing Applications in The in
    INFS3607	Distributed Computer Systems
    LAND1131	Introduction To Computer Applica
    LAWS1032	Computer Applications to Law
    LAWS4620	Computer Applications To Law
    LIBS0233	Computer Applications in The Inf
    MANF3500	Computers in Manufacturing 1
    MANF4500	Computers in Manufacturing 2
    MANF8560	Computer Integrated Manufact.
    MANF9500	Computer-aided Progrmg for Numcl
    MANF9560	Computer Integrated Manufact.
    MARK3022	Computer Applications in Marketi
    MATH1061	Introductory Applied Computing
    MATH2301	Mathematical Computing
    MATH2430	Symbolic Computing
    MATH2810	Statistical Computing
    MATH2910	Higher Statistical Computing
    MATH3301	Advanced Math Computing
    MATH3430	Symbolic Computing
    MATH3821	Stat Modelling & Computing
    MATH5315	High Perf Numerical Computing
    MATH9315	Topics in Mathematical Computing
    MATS1021	Computing in Materials Science
    MECH1500	Computing 1M
    MECH3500	Computing 2M
    MECH3510	Computing Applications in Mech.
    MECH3530	Computing Applcts in Mechanical
    MECH4130	Computer-aided Engineering Desig
    MECH4500	Computing 3M
    MEFT5103	Computer Media
    MINE0710	Computing 1
    MINE1720	Microcomputers (mining)
    MINE1730	Computer Applications in Mining
    MTRN3530	Computing Applcts in Mech.Sys.
    PHIL5206	AI & Computer Science
    PHIL5207	Ai & Computer Science 2A
    PHYS2601	Computer Applications 2
    PHYS3601	Computer Applications in Instrum
    PHYS3620	Computer Based Signal Processing
    PLAN1061	Computer Literacy
    PSYC3191	Computer Science & Psychology
    PTRL1013	Computing-Petroleum Engineers
    REGS0428	Computer Applications in Linguis
    REGS3410	Computer Networks
    REGS3873	Introduction To Computer Graphic
    SART1681	Multimedia Computing Elective1
    SART1810	Introduction to Computing
    SART2681	Multimedia Computing Elective2
    SART2811	Multimedia Computing Workshop
    SART3681	Multimedia Computing Elective3
    SART3840	Advanced Multimedia Computing
    SART9725	Intro to Multimedia Computing
    SART9739	Multimedia Computing Elective
    SDES1106	Design and Computers 1
    SDES1110	Design and Computers 2
    SDES1111	Integrated Design Computing 1
    SDES1211	Integrated Design Computing 2
    SDES2107	Design and Computers 3
    SDES2115	Design and Computers 2B
    SDES3107	Design and Computers 4
    SDES3173	Advanced Computer Graphics
    SDES4103	Design and Computers 4
    SDES6714	Intro 3D Computer Aided Design
    SLSP2902	Computers and Comm.
    SOCI3401	Computer Analysis of Social Data
    SOCI3408	Computer Analysis of Social Data
    SOMA1681	Intro Multimedia Computing
    SOMA1810	Introduction to Computing
    SOMA2402	Tangible Computing
    SOMA2681	Advanced Multimedia Computing
    SOMA2811	Multimedia Computing Workshop
    SURV1111	Introduction To Computing
    SURV2111	Principles of Computer Processin
    SURV2122	Computer Graphics 1
    SURV4111	Data Analysis & Computing 1
    SURV5111	Data Analysis & Computing 2
    SURV5122	Computer Graphics 2
    SURV6121	Computer Graphics
    TABL1002	Computer Information Systems
    TEDG1101	Computers in Education
    TEDG1106	Computer-based Resources: Design
    TEDG1107	Managing With Computers in Schoo
    TEDG1112	Computers - Gifted & Talented St
    TEDG1113	Computer Control Technology in E
    TEED1134	Fundamentals of Computing
    TEED2119	Computers & People
    TELE9302	Computer Networks
    TEXT2501	Computing Applications
    ZEIT1110	Computer Games
    ZEIT2102	Computer Technology
    ZEIT2104	Computers and Security
    ZEIT2305	Computer Games
    ZEIT3113	Computer Languages & Algorithm
    ZEIT3304	Computing Proj - Info Sys
    ZEIT3307	Computer Games
    ZEIT8020	Computer Network Operations
    ZEIT9100	Computer Science Research F/T
    ZEIT9101	Computer Science Research P/T
    ZGEN2300	Computers in Society
    ZGEN2301	Computer Games
    ZITE1001	Computer Tools for Engineers
    ZITE1101	Intro to Computer Science
    ZITE2101	Computer Languages & Algorithm
    ZITE2102	Computer Technology
    ZITE3101	Computing Proj - Comp Sci
    ZITE3105	Human Computer Interaction
    ZITE3106	Interactive Computer Graphics
    ZITE3113	Computer Languages & Algorithm
    ZITE3211	Microcomputer Interfacing
    ZITE3304	Computing Proj - Info Sys
    ZITE4101	Computer Sci 4 (Comb Hons) F/T
    ZITE4102	Computer Sci 4 (Comb Hon) P/T
    ZITE4103	Computer Science 4 (Hons) F/T
    ZITE4104	Computer Science 4 (Hons) P/T
    ZITE8103	Computer Graphics
    ZITE8104	Computer Security
    ZITE8105	Computer Speech Processing
    ZITE9100	Computer Science Research F/T
    ZITE9101	Computer Science Research P/T
    
    The last ones are from the Computer Science school at ADFA.
  2. Consider a file called enrollments which contains data about student enrollment in courses. There is one line for each student enrolled in a course:
    ls -l enrollments
    -rw-r--r-- 1 cs2041 cs2041 1283115 Jun  2 13:38 enrollments
    
    wc enrollments
      11355   63303 1283115 enrollments
    
    head enrollments
    COMP1911|5256529|Fang, . Jiayi Simon Evan                          |3785/1|COMPA1       |068.727|22T2|20011030|M
    COMP4952|5240354|Jackson, Eric Jake                                |8543  |MTRNAH       |075.125|22T2|19931124|M
    COMP9313|5269875|Pham, Vanessa Michelle Bianca                     |3778/3|MTRNAH       |077.579|22T2|19971117|F
    COMP1911|5293279|Qiao, Brandon Wayne                               |8543  |COMPA1 FINSA1|060.000|22T2|19991101|M
    COMP1511|5298681|Yee, Harsh Justin                                 |8543  |COMPAH       |076.333|22T2|20000713|M
    COMP1511|5233668|Jiang, Olivia Vivian                              |8543  |COMPA1       |087.467|22T2|19990626|F
    COMP2041|5200989|Jia, Luke                                         |3778/3|COMPAS       |063.575|22T2|20030922|M
    COMP9511|5257232|Zhu, . Madeleine                                  |8543  |MTRNAH       |078.444|22T2|19980401|F
    COMP1911|5265743|Park, Sophie                                      |3785/5|COMPI1       |084.000|22T2|20010130|F
    COMP9902|5220471|Qin, Jasmine                                      |8543  |COMPAS       |044.545|22T2|20010419|F
    
    The following commands count how many students are enrolled in COMP2041 or COMP9041. The course IDs differ only in one character, so a character class is used instead of alternation.

    The first version below is often ferred because initially you may want to know "how many xxx", then having found that out the next question might be, "well give me a sample of 10 or so of them". Then it's a simple matter of replacing wc by head.

    grep -E '^COMP(2041|9044)' enrollments | wc -l
    866
    
    grep -E -c '^COMP(2041|9044)' enrollments
    866
    
    The last field field in the enrollment file records the student's gender. This command counts the number of female students enrolled in the courses.
    grep -E '^COMP(2041|9044)' enrollments | grep -E 'F$' | wc -l
    213
    
    Not a very good gender balance, is it?

    By the way, the two grep -Es could have been combined into one. How?

    This command will give a sorted list of course codes:

    cut -d'|' -f1 enrollments | sort | uniq
    COMP1010
    COMP1511
    COMP1521
    COMP1531
    COMP1911
    COMP2041
    COMP2511
    COMP2521
    COMP3121
    COMP3141
    COMP3151
    COMP3153
    COMP3331
    COMP3511
    COMP3900
    COMP3901
    COMP4336
    COMP4601
    COMP4951
    COMP4952
    COMP4953
    COMP4961
    COMP4962
    COMP4963
    COMP6443
    COMP6447
    COMP6452
    COMP6721
    COMP6741
    COMP6771
    COMP6843
    COMP9020
    COMP9021
    COMP9024
    COMP9044
    COMP9101
    COMP9153
    COMP9154
    COMP9242
    COMP9311
    COMP9312
    COMP9313
    COMP9319
    COMP9323
    COMP9331
    COMP9336
    COMP9414
    COMP9417
    COMP9444
    COMP9447
    COMP9491
    COMP9511
    COMP9517
    COMP9727
    COMP9900
    COMP9901
    COMP9902
    COMP9991
    COMP9992
    COMP9993
    
    The student records system known to users as myUNSW is built on top of a large US product known as PeopleSoft (the company was taken over by Oracle in 2004). On a scale of 1 to 10 the quality of the design of this product is about 3. One of its many flaws is its insistence that everybody must have two names, a "Last Name" and a "First Name", neither of which can be empty. To signify that a person has only a single name (common in Sri Lanka, for example), the system stores a dot character in the "First Name" field. The enrollments file shows the data as stored in the system, with a comma and space separating the component names. It has some single-named people (note that the names themselves have been disguised):
    grep -E ', \.' enrollments
    COMP1911|5256529|Fang, . Jiayi Simon Evan                          |3785/1|COMPA1       |068.727|22T2|20011030|M
    COMP9511|5257232|Zhu, . Madeleine                                  |8543  |MTRNAH       |078.444|22T2|19980401|F
    COMP2041|5246160|Ye, . Hannah Natalie                              |3674/1|COMPA1 MATHM1|067.222|22T2|19950725|F
    COMP3121|5246160|Ye, . Hannah Natalie                              |3674/1|COMPA1 MATHM1|067.222|22T2|19950725|F
    COMP3511|5246160|Ye, . Hannah Natalie                              |3674/1|COMPA1 MATHM1|067.222|22T2|19950725|F
    COMP1531|5289701|Thomas, .                                         |3778/2|COMPCS       |072.000|22T2|19940408|M
    COMP2511|5254968|Patel, . Christine Chelsea Maryam Karen           |3778/2|COMPBH       |000.000|22T2|20060422|F
    COMP3121|5254968|Patel, . Christine Chelsea Maryam Karen           |3778/2|COMPBH       |000.000|22T2|20060422|F
    COMP3331|5254968|Patel, . Christine Chelsea Maryam Karen           |3778/2|COMPBH       |000.000|22T2|20060422|F
    COMP9311|5230661|Qiu, . Celine                                     |3707/1|SENGAH       |067.400|22T2|19990912|F
    COMP2521|5258230|Zhang, . Hugo                                     |3791/2|COMPAS       |072.500|22T2|20070614|M
    COMP1531|5286347|Cao, .                                            |3778/2|ELECAH       |052.364|22T2|20000324|M
    COMP9313|5289700|Lai, . Fiona                                      |3707/2|COMMJ1 COMPA1|071.850|22T2|20010630|F
    COMP9417|5289700|Lai, . Fiona                                      |3707/2|COMMJ1 COMPA1|071.850|22T2|20010630|F
    COMP2511|5258475|Kim, . Christine Andrea Joanne                    |3785/1|COMPAS COMPSS|070.133|22T2|19990225|F
    COMP6452|5258475|Kim, . Christine Andrea Joanne                    |3785/1|COMPAS COMPSS|070.133|22T2|19990225|F
    COMP9417|5269299|Tran, . Charlotte                                 |3778/2|COMPA1 ELECAH|062.667|22T2|19971205|F
    COMP9444|5269299|Tran, . Charlotte                                 |3778/2|COMPA1 ELECAH|062.667|22T2|19971205|F
    COMP1911|5230656|Luu, .                                            |3764/2|COMPA1       |068.091|22T2|19961218|M
    COMP9044|5288448|An, .                                             |3778/3|SENGAH       |059.250|22T2|20040713|M
    COMP9154|5288448|An, .                                             |3778/3|SENGAH       |059.250|22T2|20040713|M
    COMP9444|5299023|Khan, .                                           |3778/2|COMPD1       |070.095|22T2|20000721|M
    COMP9517|5299023|Khan, .                                           |3778/2|COMPD1       |070.095|22T2|20000721|M
    COMP1511|5230333|Hou, . Natalie Zihan                              |3784/2|COMPE1       |082.667|22T2|20090220|F
    COMP9020|5263602|Wei, .                                            |3778/3|FINSA1 SENGAH|067.833|22T2|20041229|M
    COMP3511|5264143|Lai, . Nikki                                      |3764/4|SENGAH       |084.333|22T2|20050415|F
    COMP6452|5264143|Lai, . Nikki                                      |3764/4|SENGAH       |084.333|22T2|20050415|F
    COMP1511|5285435|Lau, .                                            |3786/4|SENGAH       |075.500|22T2|20020802|F
    COMP2041|5248314|Chow, .                                           |1650  |COMPA1       |055.800|22T2|19700208|M
    COMP2521|5248314|Chow, .                                           |1650  |COMPA1       |055.800|22T2|19700208|M
    COMP6443|5248314|Chow, .                                           |1650  |COMPA1       |055.800|22T2|19700208|M
    COMP9101|5200193|Hao, .                                            |3785/4|COMPA1       |000.000|22T2|20000128|M
    COMP9313|5200193|Hao, .                                            |3785/4|COMPA1       |000.000|22T2|20000128|M
    COMP9323|5200193|Hao, .                                            |3785/4|COMPA1       |000.000|22T2|20000128|M
    COMP1521|5285782|Jin, .                                            |8543  |COMPA1       |068.619|22T2|19960513|F
    COMP2521|5285782|Jin, .                                            |8543  |COMPA1       |068.619|22T2|19960513|F
    COMP1521|5268743|Yeh, .                                            |8543  |SENGAH       |073.500|22T2|20010309|M
    COMP2511|5279276|Yin, . Sally                                      |3707/4|COMPY1       |085.103|22T2|20070809|F
    COMP3121|5279276|Yin, . Sally                                      |3707/4|COMPY1       |085.103|22T2|20070809|F
    COMP3900|5279276|Yin, . Sally                                      |3707/4|COMPY1       |085.103|22T2|20070809|F
    COMP6771|5239659|Chau, . Joseph                                    |3778/1|COMPAS       |076.333|22T2|20081105|M
    COMP9323|5239659|Chau, . Joseph                                    |3778/1|COMPAS       |076.333|22T2|20081105|M
    COMP9900|5239659|Chau, . Joseph                                    |3778/1|COMPAS       |076.333|22T2|20081105|M
    COMP1531|5231967|Leung, . Lina Yu                                  |3332/2|BINFAH       |079.333|22T2|19911030|F
    COMP2521|5231967|Leung, . Lina Yu                                  |3332/2|BINFAH       |079.333|22T2|19911030|F
    COMP3511|5291863|Lai, .                                            |3785/5|COMPBH       |000.000|22T2|19981124|F
    COMP6443|5291863|Lai, .                                            |3785/5|COMPBH       |000.000|22T2|19981124|F
    COMP1511|5257659|Xu, .                                             |3785/2|COMPAS COMPSS|000.000|22T2|20040117|M
    COMP1521|5297051|Wei, . Rachel Lily                                |3778/2|COMPA1 UNDL-U|062.600|22T2|20020415|F
    COMP2521|5297051|Wei, . Rachel Lily                                |3778/2|COMPA1 UNDL-U|062.600|22T2|20020415|F
    COMP9444|5272814|Wei, . William Joseph                             |3767/2|COMPCS       |082.438|22T2|19950425|M
    COMP1531|5250077|Jin, . Michael Ken Jiaqi                          |3707/3|CHEMD2 PHYSL1|074.857|22T2|20021121|M
    COMP1511|5249265|Shah, .                                           |3778/2|BINFAH       |062.667|22T2|19951228|M
    COMP1521|5249622|Tran, . Xiao                                      |3764/2|AEROAH       |068.000|22T2|19960412|F
    COMP1511|5298091|You, . Tian                                       |3791/1|COMPBH       |083.462|22T2|19970823|M
    COMP1531|5218254|Ang, .                                            |3778/2|COMPA1       |000.000|22T2|20000927|M
    COMP4951|5296731|Cao, . Jasmine                                    |8543  |COMPBH FINSA1|056.870|22T2|19950705|F
    COMP6771|5210641|Chen, . Cameron Oliver                            |8543  |MATHE1       |072.500|22T2|19930819|M
    COMP9021|5231224|Ngo, .                                            |7543  |COMPA1       |066.000|22T2|19920303|F
    COMP9311|5231224|Ngo, .                                            |7543  |COMPA1       |066.000|22T2|19920303|F
    COMP9331|5231224|Ngo, .                                            |7543  |COMPA1       |066.000|22T2|19920303|F
    COMP9044|5275519|Bell, . Ke                                        |3707/4|UNDL-U       |068.556|22T2|20050701|M
    COMP9101|5275519|Bell, . Ke                                        |3707/4|UNDL-U       |068.556|22T2|20050701|M
    COMP9021|5213679|Yin, . Laura Yang                                 |3778/2|COMPAS COMPSS|078.667|22T2|20000104|F
    COMP1511|5215560|Jackson, . Martin                                 |3778/3|COMPA1       |044.750|22T2|20050918|M
    COMP2521|5273729|Leung, . Alicia                                   |3778/2|COMPA1       |062.000|22T2|20021115|F
    COMP1511|5256758|Qiu, . Jason                                      |8543  |COMPA1       |067.500|22T2|20030914|M
    
    What would have happened if we forgot the backslash?

    If we wanted to know how many different students there were of this type rather than all enrollments, just cut out the second field (student ID) and use uniq. It's not necessary to sort the data in this case only because the data is clustered, that is, all equal values are adjacent although they're not necessarily sorted.

    grep -E ', \.' enrollments | cut -d'|' -f2 | uniq | wc
         42      42     336
    
  3. Now let us turn our attention from students and courses to programs. The enrollments file, as well as linking a student to the courses they're taking, also links them to the program (degree) that they are currently enrolled in. Consider that we want to find out the program codes of the students taking COMP2041. The following pipeline will do this:
    grep -E 'CCOMP(2041|9044)' enrollments | cut -d'|' -f4 | cut -d/ -f1  | sort | uniq
    
    If we want to know how many students come from each program, ordered from most common program to least common program, try this:
    grep -E 'COMP(2041|9044)' enrollments | cut -d'|' -f4 | cut -d/ -f1 | sort | uniq -c | sort -nr
        222 8543  
        195 3778
         93 3707
         52 3784
         45 3785
         28 3789
         23 3959
         21 3768
         21 3674
         15 3764
         15 1650  
         14 3781
         11 3782
         10 7543  
          9 4515
          7 5543  
          7 3767
          7 3762
          6 3673
          4 8338  
          4 3970
          4 3791
          4 3786
          3 8750
          3 3783
          3 3736
          3 3706
          3 3155
          2 8959  
          2 3966
          2 3962
          2 3761
          2 3584
          2 3529
          2 3409
          2 3133
          2 2645  
          1 6115
          1 4787
          1 3979
          1 3978
          1 3969
          1 3956
          1 3586
          1 3566
          1 3502
          1 3387
          1 3268
          1 3261
          1 3131
          1 2475  
          1 1710  
          1 1630  
    
    Note that a tab is usually inserted between the count and the data, but not all implementations of the uniq command ensure this.
  4. Consider a file called program_codes that contains the code and name of each program offered at UNSW (excluding research programs):

    wc program_codes
     250 1001 7045 program_codes
    
    head program_codes
    1004	Joint	PhD
    1292	PhD	Art,	Design	and	Media
    1400	Psychology
    1540	Economics
    1545	Actuarial	Studies
    1550	Marketing
    1561	Banking	and	Finance
    1630	Civil	&	Environmental	Eng
    1640	Electrical	Engineering
    1650	Computer	Science	and	Eng
    
    We can use this file to give more details of the programs that COMP2041 students are taking, if some users don't want to deal with just course codes.
    grep -E 'COMP(2041|9044)' enrollments | cut -d'|' -f4 | cut -d/ -f1 | sort | uniq | join - program_codes
    1630  Civil & Environmental Eng
    1650  Computer Science and Eng
    1710  Biomedical Engineering
    2475  Science (MPhil)
    2645  Engineering (MPhil)
    3131 Mat Sci and Eng Hons
    3133 Mat Sci and Eng Hons/BiomedEng
    3155 Actuarial Studies / Commerce
    3261 Architectural Studies
    3268 Computational Design
    3387 Industrial Design
    3409 Arts
    3502 Commerce
    3529 Commerce/Science
    3566 Economics/Adv Science (Hons)
    3584 Commerce / Information Systems
    3586 Actuarial Studies
    3673 Economics / Computer Science
    3674 Actuarial Stu / Computer Sci
    3706 Engineering Science
    3707 Engineering (Honours)
    3736 BE (Hons) ME Elec Eng
    3761 Adv Math (Hons) / Eng (Hons)
    3762 AdvSci(Hons)/Engineering(Hons)
    3764 Engineering (Hons)/Commerce
    3767 Engineering (Hons) / Science
    3768 Eng (Hons) / MBiomedE
    3778 Computer Science
    3781 Adv Maths (Hons) / Comp Sci
    3782 Adv Science (Hons) / Comp Sci
    3783 Computer Science / Arts
    3784 Commerce / Computer Science
    3785 Engineering (Hons) / Comp Sci
    3786 Computer Science / Law
    3789 Science / Computer Science
    3791 Computer Science / Media Arts
    3956 Advanced Mathematics (Honours)
    3959 Data Science and Decisions
    3962 Advanced Science (Honours)
    3966 Life Sciences
    3969 Media Arts (Hons) / Comp Sci
    3970 Science
    3978 Computer Science
    3979 Information Systems
    4515 Comp Sci & Eng (Honours)
    5543  Information Technology
    6115 UNSW Preparation Program 17-19
    7543  Computing
    8338  Engineering Science
    8543  Information Technology
    8750 Statistics
    8959  Data Science and Decisions
    
    We can combine the enrollment counts (for both courses) with the program titles to produce a self-descriptive tally. It's even better if it's in decreasing order of popularity, so after joining the tallies with the program titles, re-sort the composite data:
    grep -E 'COMP(2041|9044)' enrollments | cut -d'|' -f4 | cut -d/ -f1 | sort | uniq -c | join -1 2 -a 1 - program_codes  | sort -k2rn
    8543 222  Information Technology
    3778 195 Computer Science
    3707 93 Engineering (Honours)
    3784 52 Commerce / Computer Science
    3785 45 Engineering (Hons) / Comp Sci
    3789 28 Science / Computer Science
    3959 23 Data Science and Decisions
    3674 21 Actuarial Stu / Computer Sci
    3768 21 Eng (Hons) / MBiomedE
    1650 15  Computer Science and Eng
    3764 15 Engineering (Hons)/Commerce
    3781 14 Adv Maths (Hons) / Comp Sci
    3782 11 Adv Science (Hons) / Comp Sci
    7543 10  Computing
    4515 9 Comp Sci & Eng (Honours)
    3762 7 AdvSci(Hons)/Engineering(Hons)
    3767 7 Engineering (Hons) / Science
    5543 7  Information Technology
    3673 6 Economics / Computer Science
    3786 4 Computer Science / Law
    3791 4 Computer Science / Media Arts
    3970 4 Science
    8338 4  Engineering Science
    3155 3 Actuarial Studies / Commerce
    3706 3 Engineering Science
    3736 3 BE (Hons) ME Elec Eng
    3783 3 Computer Science / Arts
    8750 3 Statistics
    2645 2  Engineering (MPhil)
    3133 2 Mat Sci and Eng Hons/BiomedEng
    3409 2 Arts
    3529 2 Commerce/Science
    3584 2 Commerce / Information Systems
    3761 2 Adv Math (Hons) / Eng (Hons)
    3962 2 Advanced Science (Honours)
    3966 2 Life Sciences
    8959 2  Data Science and Decisions
    1630 1  Civil & Environmental Eng
    1710 1  Biomedical Engineering
    2475 1  Science (MPhil)
    3131 1 Mat Sci and Eng Hons
    3261 1 Architectural Studies
    3268 1 Computational Design
    3387 1 Industrial Design
    3502 1 Commerce
    3566 1 Economics/Adv Science (Hons)
    3586 1 Actuarial Studies
    3956 1 Advanced Mathematics (Honours)
    3969 1 Media Arts (Hons) / Comp Sci
    3978 1 Computer Science
    3979 1 Information Systems
    4787 1
    6115 1 UNSW Preparation Program 17-19
    
    Note the curious extra space before the title of some programs. It took me a while to work it out, can you? (Hint: how are the programs shown in the enrollment file?) Suggest an appopriate change to the pipeline.
  5. Lecture exercises on wc:
    1. how many different programs does UNSW offer?
      wc -l program_codes
      250 program_codes
      
    2. how many times was WebCMS accessed?
      wc -l access_log
      59779 access_log
      
    3. how many students are studying in CSE?
      wc -l enrollments
      11355 enrollments
      

      The above solutions assume that we're talking about total enrollments. If the question actually meant how many distinct indivduals are studying courses offered by CSE, then we'd answer it as:

      cut -d'|' -f2 enrollments | sort | uniq | wc -l
      6843
      
    4. how many words are there in the book?
      wc -w book
      60428 book
      
    5. how many lines are there in the story?
      wc -l story
      87 story
      
Shell
Shell commands for power users.

#include <stdio.h>

// print arguments to stdout
int main(int argc, char *argv[]) {

    for (int i = 1; i < argc; i++) {
        if (i > 1) {
            fputc(' ', stdout);
        }
        fputs(argv[i], stdout);
    }
    fputc('\n', stdout);

    return 0;
}

Download echo.c



import sys


def main():
    """
    print arguments to stdout
    """
    print(' '.join(sys.argv[1:]))


if __name__ == '__main__':
    main()

Download echo.py


A simple shell script demonstrating access to arguments.
echo My name is "$0"
echo My process number is $$
echo I have $# arguments

# your not going to see any difference unless you use these in a loop
echo My arguments separately are $*
echo My arguments together are "$*"
echo My arguments separately are $@
echo My arguments as quoted are "$@"

echo My 5th argument is "'$5'"
echo My 10th argument is "'${10}'"
echo My 255th argument is "'${255}'"

Download args.sh


$ ./accessing_args.sh one two "three four"
Using $*: one two three four
Using "$*": one two three four
Using "$@": one two three four
echo 'Using $*:'
for a in $*
do
    echo "$a"
done

echo 'Using "$*":'
for a in "$*"
do
    echo "$a"
done

# This is the way to loop over command-line arguments
echo 'Using "$@":'
for a in "$@"
do
  echo "$a"
done

Download accessing_args.sh


l [file|directories...] - list files


Short shell scripts can be used for convenience.

It is common to put these scripts in a directory such as /home/z1234567/scripts then add this directory to PATH e.g in .bash_login
PATH=$PATH:/home/z1234567/scripts

Note: "$@" like $* expands to the arguments to the script, but preserves whitespace in arguments.
ls -las "$@"

Download l

simple emulation of /usr/bin/seq for a COMP(2041|9044) example

Print the integers 1..n or n..m
if test $# = 1
then
    first=1
    last=$1
elif test $# = 1
then
    first=$1
    last=$2
else
    echo "Usage: $0 <last> or  $0 <first> <last>" 1>&2
fi

number=$first
while test $number -le "$last"
do
    echo $number
    number=$((number + 1))
done

Download seq.v1.sh

simple emulation of /usr/bin/seq for a COMP(2041|9044) example
Print the integers 1..n or m..n
if [ $# = 1 ]
then
    first=1
    last=$1
elif [ $# = 1 ]
then
    first=$1
    last=$2
else
    echo "Usage: $0 <last> or  $0 <first> <last>" 1>&2
fi

number=$first
while [ $number -le $last ]
do
    echo $number
    number=$((number + 1))
done

Download seq.v2.sh


Repeatedly download a specified web page until a specified regexp matches its source then notify the specified email address.

For example:
repeat_seconds=300  #check every 5 minutes

if test $# = 3
then
    url=$1
    regexp=$2
    email_address=$3
else
    echo "Usage: $0 <url> <regex>" 1>&2
    exit 1
fi

while true
do
    if curl --silent "$url"|grep -E "$regexp" >/dev/null
    then
        echo "Generated by $0" |
        mail -s "$url now matches $regexp" "$email_address"
        exit 0
    fi
    sleep $repeat_seconds
done

Download watch_website.sh



Change the names of the specified files to lower case. (simple version of the perl utility rename)

Note use of test to check if the new filename is unchanged.

Note the double quotes around $filename so filenames containing spaces are not broken into multiple words

Note the use of mv -- to stop mv interpreting a filename beginning with - as an option

Note files named -n or -e still break the script because echo will treat them as an option,
if test $# = 0
then
    echo "Usage $0: <files>" 1>&2
    exit 1
fi

for filename in "$@"
do
    new_filename=$(echo "$filename" | tr '[:upper:]' '[:lower:]')

    test "$filename" = "$new_filename" &&
        continue

    if test -r "$new_filename"
    then
        echo "$0: $new_filename exists" 1>&2
    elif test -e "$filename"
    then
        mv -- "$filename" "$new_filename"
    else
        echo "$0: $filename not found" 1>&2
    fi

done

Download tolower.sh

create 1001 C files, compile and run them
this programs create 1000 files f0.c .. f999.c file f$i.c contains function f$i which returns $i for example file42.c contains function f42 which returns 42 main.c is created with code to call all 1000 functions and print the sum of their return values
first add the initial lines to main.c note the use of quotes on eof to disable variable interpolation in the here document
cat >main.c <<'eof'
#include <stdio.h>

int main(void) {
    int v = 0 ;
eof

i=0
while test $i -lt 1000
do
    # add a line to main.c to call the function f$i

    cat >>main.c <<eof
    int f$i(void);
    v += f$i();
eof

    # create file$i.c containing function f$i

    cat >file$i.c <<eof
int f$i(void) {
    return $i;
}
eof

    i=$((i + 1))
done

cat >>main.c <<'eof'
    printf("%d\n", v);
    return 0;
}
eof

# compile and run the 1001 C files
# time clang main.c file*.c
# ./a.out

Download create_1001_file_C_program.sh


set -x
# written by andrewt@unsw.edu.au for COMP(2041|9044)
#
# Run as plagiarism_detection.simple_diff.sh <files>
# Report if any of the files are copies of each other
#
# Note use of diff -iw so changes in white-space or case
# are ignored

for file1 in "$@"
do
    for file2 in "$@"
    do
        test "$file1" = "$file2" &&
            break # avoid comparing pairs of assignments twice

        if diff -i -w "$file1" "$file2" >/dev/null
        then
            echo "$file1 is a copy of $file2"
        fi

    done
done

Download plagiarism_detection.simple_diff.sh



Improved version of plagiarism_detection.simple_diff.sh

The substitution s/\/\/.*// removes // style C comments.
This means changes in comments won't affect comparisons.

Note use of temporary files
TMP_FILE1=/tmp/plagiarism_tmp1$$
TMP_FILE2=/tmp/plagiarism_tmp2$$


for file1 in "$@"
do
    for file2 in "$@"
    do
        test "$file1" = "$file2" &&
            break # avoid comparing pairs of assignments twice

        sed 's/\/\/.*//' "$file1" >$TMP_FILE1
        sed 's/\/\/.*//' "$file2" >$TMP_FILE2

        if diff -i -w $TMP_FILE1 $TMP_FILE2 >/dev/null
        then
            echo "$file1 is a copy of $file2"
        fi

    done
done

rm -f $TMP_FILE1 $TMP_FILE2

Download plagiarism_detection.comments.sh



Improved version of plagiarism_detection.comments.sh
change all C strings to the letter 's' and change all identifiers to the letter 'v'.
Hence changes in strings & identifiers will be ignored.
TMP_FILE1=/tmp/plagiarism_tmp1$$
TMP_FILE2=/tmp/plagiarism_tmp2$$

# s/"["]*"/s/g changes strings to the letter 's'
# It won't match a few C strings which is OK for our purposes

# s/[a-zA-Z_][a-zA-Z0-9_]*/v/g changes variable names to 'v'
# It will also change function names, keywords etc.
# which is OK for our purposes.

substitutions='
    s/\/\/.*//
    s/"[^"]"/s/g
    s/[a-zA-Z_][a-zA-Z0-9_]*/v/g'

for file1 in "$@"
do
    for file2 in "$@"
    do
        test "$file1" = "$file2" &&
            break # avoid comparing pairs of assignments twice

        sed "$substitutions" "$file1" >$TMP_FILE1
        sed "$substitutions" "$file2" >$TMP_FILE2

        if diff -i -w $TMP_FILE1 $TMP_FILE2 >/dev/null
        then
            echo "$file1 is a copy of $file2"
        fi
    done
done
rm -f $TMP_FILE1 $TMP_FILE2

Download plagiarism_detection.identifiers.sh



Improved version of plagiarism_detection.identifiers.sh

Note the use of sort so line reordering won't prevent detection of plagiarism.
TMP_FILE1=/tmp/plagiarism_tmp1$$
TMP_FILE2=/tmp/plagiarism_tmp2$$

substitutions='
    s/\/\/.*//
    s/"[^"]"/s/g
    s/[a-zA-Z_][a-zA-Z0-9_]*/v/g'

for file1 in "$@"
do
    for file2 in "$@"
    do
        test "$file1" = "$file2" &&
            break # avoid comparing pairs of assignments twice

        sed "$substitutions" "$file1"|sort >$TMP_FILE1
        sed "$substitutions" "$file2"|sort >$TMP_FILE2

        if diff -i -w $TMP_FILE1 $TMP_FILE2 >/dev/null
        then
            echo "$file1 is a copy of $file2"
        fi
    done
done
rm -f $TMP_FILE1 $TMP_FILE2

Download plagiarism_detection.reordering.sh



Improved version of plagiarism_detection.reordering.sh with robust creation and removal of temporary files
TMP_FILE1=$(mktemp /tmp/plagiarism_tmp.1.XXXXXXXXXX)
TMP_FILE2=$(mktemp /tmp/plagiarism_tmp.2.XXXXXXXXXX)
trap 'rm -f $TMP_FILE1 $TMP_FILE2;exit' INT TERM EXIT

substitutions='
    s/\/\/.*//
    s/"[^"]"/s/g
    s/[a-zA-Z_][a-zA-Z0-9_]*/v/g'

for file1 in "$@"
do
    for file2 in "$@"
    do
        test "$file1" = "$file2" &&
            break # avoid comparing pairs of assignments twice

        sed "$substitutions" "$file1"|sort >$TMP_FILE1
        sed "$substitutions" "$file2"|sort >$TMP_FILE2

        if diff -i -w $TMP_FILE1 $TMP_FILE2 >/dev/null
        then
            echo "$file1 is a copy of $file2"
        fi
    done
done

Download plagiarism_detection.mktemp.sh

Python Intro

"""
Compute Pythagoras' Theorem

written by d.brotherston@unsw.edu.au as a COMP(2041|9044) lecture example
translated from perl written by andrewt@cse.unsw.edu.au
"""

import math

x = float(input("Enter x: "))
y = float(input("Enter y: "))

pythagoras = math.sqrt(x**2 + y**2)

print(f"Square root of {x} squared + {y} squared is {pythagoras}")

Download pythagoras.py


"""
Read numbers until end of input (or a non-number) is reached
Then print the sum of the numbers

written by d.brotherston@unsw.edu.au as a COMP(2041|9044) lecture example
translated from perl written by andrewt@cse.unsw.edu.au
"""

from sys import stdin

sum = 0

for line in stdin:

    line = line.strip()

    try:
        sum += int(line)
    except ValueError as e:
        print(e)

print(f"Sum of the numbers is {sum}")

Download sum_stdin.py


"""
Simple example reading a line of input and examining characters
written by d.brotherston@unsw.edu.au as a COMP(2041|9044) lecture example
"""

try:
    line = input("Enter some input: ")
except EOFError:
    print("could not read any characters")
    exit(1)

n_chars = len(line)
print(f"That line contained {n_chars} characters")

if n_chars > 0:
    first_char = line[0]
    last_char = line[-1]
    print(f"The first character was '{first_char}'")
    print(f"The last character was '{last_char}'")

Download line_chars.py


"""
Reads lines of input until end-of-input
Print "snap!" if two consecutive lines are identical

written by d.brotherston@unsw.edu.au as a COMP(2041|9044) lecture example
translated from perl written by andrewt@cse.unsw.edu.au
"""

last = None;

while True:
    try:
        curr = input("Enter line: ")
    except EOFError:
        print()
        break

    if curr == last:
        print("Snap!")
        break

    last = curr

Download snap_consecutive.py


"""
Create a string of size 2^n by concatenation
written by d.brotherston@unsw.edu.au as a COMP(2041|9044) lecture example
"""

import sys

if len(sys.argv) != 2:
    print(f"Usage: {sys.argv[0]}: <n>")
    exit(1)

n = 0
string = "@"

while n < int(sys.argv[1]):
    string *= 2
    # or `string += string`
    # or `string = string + string`
    n += 1

print(f"String of 2^{n} = {len(string)} characters created")

Download exponential_concatenation.py

Python More

Python implementation of /bin/echo
using indexing & while, not pythonesque
import sys

i = 1
while i < len(sys.argv):
    if i > 1:
        print(" ", end="")
    print(sys.argv[i], end="")
    i += 1
print()

Download echo.0.py


Python implementation of /bin/echo
using indexing & range, not pythonesque
import sys

for i in range(1, len(sys.argv)):
    if i > 1:
        print(' ', end='')
    print(sys.argv[i], end='')
print()

Download echo.1.py


Python implementation of /bin/echo
import sys

if sys.argv[1:]:
    print(sys.argv[1], end='')
for arg in sys.argv[2:]:
    print('', arg, end='')
print()

Download echo.2.py


Python implementation of /bin/echo
import sys

print(' '.join(sys.argv[1:]))

Download echo.3.py


Python implementation of /bin/echo
import sys

print(*argv[1:])

Download echo.4.py


sum integers supplied as command line arguments no check that arguments are integers
import sys

total = 0
for arg in sys.argv[1:]:
    total += int(arg)
print("Sum of the numbers is", total)

Download sum_arguments.0.py


sum integers supplied as command line arguments
import sys

total = 0
for arg in sys.argv[1:]:
    try:
        total += int(arg)
    except ValueError:
        print(f"error: '{arg}' is not an integer", file=sys.stderr)
        sys.exit(1)
print("Sum of the numbers is", total)

Download sum_arguments.1.py



Count the number of lines on standard input.
import sys

line_count = 0
for line in sys.stdin:
    line_count += 1
print(line_count, "lines")

Download line_count.0.py



Count the number of lines on standard input.
import sys

lines = sys.stdin.readlines()
line_count = len(lines)
print(line_count, "lines")

Download line_count.1.py



Count the number of lines on standard input.
import sys

lines = list(sys.stdin)
line_count = len(lines)
print(line_count, "lines")

Download line_count.2.py



Simple cp implementation for text files using line-based I/O explicit close is used below, a with statement would be better no error handling
import sys

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

infile = open(sys.argv[1], "r", encoding="utf-8")
outfile = open(sys.argv[2], "w", encoding="utf-8")
for line in infile:
    print(line, end='', file=outfile)
infile.close()
outfile.close()

Download cp.0.py



Simple cp implementation for text files using line-based I/O and with statement, but no error handling
import sys

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

with open(sys.argv[1]) as infile:
    with open(sys.argv[2], "w") as outfile:
        for line in infile:
            outfile.write(line)

Download cp.1.py



Simple cp implementation for text files using line-based I/O and with statement and error handling
import sys

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

try:
    with open(sys.argv[1]) as infile:
        with open(sys.argv[2], "w") as outfile:
            for line in infile:
                outfile.write(line)
except OSError as e:
    print(sys.argv[0], "error:", e, file=sys.stderr)
    sys.exit(1)

Download cp.2.py



Simple cp implementation for text files using line-based I/O reading all lines into array (not advisable for large files)
import sys

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

try:
    with open(sys.argv[1]) as infile:
        with open(sys.argv[2], "w") as outfile:
            lines = infile.readlines()
            outfile.writelines(lines)
except OSError as e:
    print(sys.argv[0], "error:", e, file=sys.stderr)
    sys.exit(1)

Download cp.3.py



Simple cp implementation using shutil.copyfile
import sys
from shutil import copyfile

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

try:
    copyfile(sys.argv[1], sys.argv[2])
except OSError as e:
    print(sys.argv[0], "error:", e, file=sys.stderr)
    sys.exit(1)

Download cp.4.py



Simple cp implementation by running /bin/cp
import subprocess
import sys

if len(sys.argv) != 3:
    print("Usage:", sys.argv[0], "<infile> <outfile>", file=sys.stderr)
    sys.exit(1)

p = subprocess.run(['cp', sys.argv[1], sys.argv[2]])
sys.exit(p.returncode)

Download cp.5.py


Python implementation of /bin/echo

Print snap! if a line has been seen previously
import sys

seen = {}
while True:
    line = input("Enter line: ")
    if not line:
        break
    if line in seen:
        print("Snap!")
    seen[line] = 1

Download snap_memory.py