Download presentation
Presentation is loading. Please wait.
Published bySabrina Eaton Modified over 8 years ago
1
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Exam Revision Ruibin Bai (Room AB326) Division of Computer Science The University of Nottingham Ningbo, China
2
Exam Format Final mark for the module is the weighted sum of your mid-term exam mark (25%) and the end-term exam mark (75%). Remember shell and awk syntax – you will need to write some short programs/scipts
3
About End-Term Exam Time: 1 Hour and Half FIVE questions, answer ALL of them!! Can be divided into two parts –Part I: drawn from the first six-week lectures, 30 points. –Part II: From the second six-week lecturers, 70 points 3 P51UST: Unix and SoftwareTools
4
Main Topics for the End-Term Exam Unix System, file system, processes, Regular expressions –Mid-term exam questions Shell programming –Coursework 1 Awk programming –Coursework 2 Version control Compilers, interpreters, debuggers Makefile Review lecture slides for all the above topics
5
Shell Programming Environment variables –PATH A list of ‘:’ separated directories that the system searches to execute commands Modify your PATH variable The order of the directories matters!!! – why? –TERM The type of terminal –Home Home directory –To find other environment variables, use env
6
Shell Programming Special variables VariableContents $#Number of command-line arguments $*All of the command-line parameters or agurments in one long string “$@”All of the command-line parameters or arguments as individual strings. $0Script name $1-$9The first nine command-line arguments or parameters. $?The return status of the most recently executed command. 0: success, 1: fail $$The process ID of the current process $!The process ID of the last background command
7
Shell Programming String quoting –Three different methods –Be able to choose appropriate ones Input/output –read, echo, printf –Be able to use them confidently Flow-control –Conditionals ( Test file conditions, String/number comparisons) –Loops Arithmetic Review coursework 1 and work on other exercises
8
Awk Programming What is awk and what does awk do? Awk syntax and options Awk variables –FS, OFS, RS, NR, NF –$0, $1, $2, … (different from those in shell programming) Pattern-action pairs Special patterns: BEGIN and END and their usage
9
AWK Programming Awk commands –Input/output: print, printf, getline, read from a pipeline –system Loops and conditionals Arrays –Assignment –Use String operations –length, index, substr, split Functions
10
A Summary of Awk Functions TypeFunction or commands Arithmeticexpintsqrtsincos randsrandlogatan2 Stringasortasortigsubindexlength splitsubstrtolowertoupper Control Flowif/elsedo/whileforbreakcontinue breakreturn I/Oprintprintfgetlinenextnextfile closefflush Programmingsystemdeletefunction 10 P51UST: Unix and SoftwareTools
11
Version Control System Purposes Locking based vs Version tracking based –Conflict resolve –Advantages and disadvantages
12
Compilers, Interpreters and Debuggers Compiler vs Interpreters –How is a program translated and executed using each translation technique? –Advantages and disadvantages Debuggers –print –Debugging tools Interpretive vs Direct Execution
13
Makefile Basics –Purposes –Targets, prerequisites, actions Principles and syntax Be able to write simple makefiles –Use of macros –Use of common Automatic variables
14
Finally Practice, practice, practice! Got questions? –Email me, or Thomas –come to my office (AB326) or Thomas’s (AB324) and…. Good luck!!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.