Programming in unix shell [ KMI/SHELL ]
The course deals with shell programming in unix-like operating systems (scripting) and text processing with use of the shell.
The course freely follows the Unix-like systems course. In the first part, basics of unix shell, files, processes and text processing on unix-like operating systems are briefly reviewed. The main contents of the course, however, is then shell programming (so-called scripting, primarily Bash shell) and its utilization in stream text processing using essential software utilities bundled with unix-like operating systems and mainly the grep, sed and awk tools. In the end, national specifics (localization) and specifics of Linux, GNU and Apple Mac OS X systems are also mentioned. Everything is intensively experienced in seminars, with strong hands-on approach, in linux operating system and Bash shell.
Prerequisities: Working skills with unix-like operating systems and programming in any language.
Seminars
- Basic principles of unix-like operating systems, introduction to shell: Command line and interpreter (shell), manual pages and shell help, files and directories, (traditional unix) access rights, processes and their manipulation. Job control in shell, file and directory names expansion, aliases, program input and output, pipe.
- Basics of text processing: Text editing: editors Vi and Emacs, basic utilities, regular expressions and grep, basics of sed and awk.
- Shell (Bash) programming: Commands, variables (parameters), conditionals, loops, integer arithmetic, command grouping, functions, script.
- Shell (Bash) programming: Shell invocation, quoting, special variables, arrays, expansion ({}, of variables and paramters, words, path), command substition, further commands.
- Text processing: stream editor sed: Editation process, edit command, function, using shell variables.
- Text processing: programming language awk: Line field, pattern and action, variables, arrays, operators, conditionals, loops, functions.
- Localization (Czech): Localization and localization shell variables, text coding and end of lines.
- Specifics against Unix (POSIX standard): Linux, GNU and Apple Mac OS X specifics (desktop and terminal, command line, help, file system, system of processes, grep, Bash, sed, awk, localization).
Literature
- Vychodil V.: Linux: Příručka českého uživatele. Computer Press, 2003. ISBN 80-7226-333-1
- Sobell M. G., Helmke M.: A Practical Guide to Linux Commands, Editors, and Shell Programming (4nd Edition). Addison-Wesley, 2017
- Albing C., Vossen JP: bash Cookbook: Solutions and Examples for Bash Users (2nd edition). O'Reilly Media, 2017. ISBN 978-1-491-97533-6
- Herold H.: awk & sed: Příručka pro dávkové zpracování textu. Coputer Press, 2004. ISBN 9788025103098
- Blum R., Bresnahan C.: Linux Command Line and Shell Scripting Bible, 3rd Edition. Wiley, 2015. ISBN 978-1-118-98384-3
- Michael R. K.: Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus. Wiley, 2008. ISBN 978-0470183014
- Forst L.: Shell v příkladech aneb aby váš unix skvěle shell. Matfyzpress, 2010. ISBN 978-80-7378-152-1
- Cooper M.: Advanced Bash-Scripting Guide. Open Publication License, 2007
- Ray D. S., Ray Eric J.: Unix: podrobný průvodce. Grada, 2009. ISBN 978-80-247-2125-5
- Čada O.: Mac OS X Shell krok za krokem. Grafika Publishing s.r.o., ISBN 80-903152-2-4
- Cannon J.: Linux for Beginners: An Introduction to the Linux Operating System and Command Line. CreateSpace Independent Publishing, 2014
- Kameník P.: Příkazový řádek v Linuxu: praktická řešení. Computer Press, 2012. ISBN 978-80-251-2819-0
- Fox R.: Linux with operating system concepts. CRC Press, 2015. ISBN 978-1-4822-3589-0
- Sobell M. G.: Mistrovství v Linuxu: Příkazový řádek, shell, programování. Computer Press, 2007. ISBN 9788025117262
- kolektiv: Linux: Dokumentační projekt, 4. aktualizované vydání. Computer Press, 2008. ISBN 9788025115251