C2110 UNIX and programming Lesson 11 -1C2110 UNIX and programming Petr Kulhanek kulhanek@chemi.muni.cz National Center for Biomolecular Research, Faculty of Science Masaryk University, Kamenice 5, CZ-62500 Brno Lesson 11 PS / 2020 Distance form of teaching: Rev4 C2110 UNIX and programming Lesson 11 -2Summary L10 ➢ AWK C2110 UNIX and programming Lesson 11 -3Process of Executing the Script C2110 UNIX and programming Lesson 11 -4AWK Scripts $ awk –f script.awk input.txt awk script analyzed text file result is printed on the screen language interpreter Indirect start: Direct launch is possible, but I do not recommend using it. AWK does not support interactive mode. Special variables: $0 whole record $1, $2, $3 ... individual record fields $i record field specified by variable "i" NF number of fields in the current record (Number of Fields) NR order of current record (Number of Records) Output: unformatted: print item1[[,] [item2]…] formatted: printf("format",…) C2110 UNIX and programming Lesson 11 -5Test II (L1-L7) ➢ Test via ROPOT in IS Student - ROPOT - C2110 • Test II (regular student) • Test IIs (students with specific needs) It is possible to compile only one set of questions at a time • from 25. 11. 0:00 to 26. 1. 23:59 The test contains 20 questions. The standard time to complete the test is 20 minutes. The question can have any number of correct answers.The answers are evaluated. The correct answer is +1 point. The wrong choice is -0.25 points. The final score is a simple sum of all points. It is allowed and recommended: • Use terminals. I recommend opening terminals before starting test. • Some questions cannot be answered correctly without online access to the WOLF cluster at the time of the test. • Search manual pages, your notes and presentation subject. • Use the internet, search engines. We expect you to complete the test separately. C2110 UNIX and programming Lesson 11 -6Next Subject ➢ Practicing C2110 UNIX and programming Lesson 11 -7- Obsah ➢ Bash + AWK + Gnuplot • Practicing • Practical examples of scripts for the exam