Visão Geral
O curso Linux Bash Shell Programming foi desenvolvido para oferecer aos participantes experiência prática no desenvolvimento e gravação de scripts Bash Shell. A maioria dos comandos shell integrados são introduzidos junto com as principais estruturas de controle do programa. O curso também oferece experiência prática no uso de uma variedade de ferramentas Linux para manipular texto e incorporar scripts shell Bash do Linux.
Exercícios e exemplos são usados ao longo do curso para proporcionar experiência prática com as técnicas abordadas.
Objetivo
Fornecer as habilidades necessárias para desenvolver e personalizar programas shell e fazer uso eficaz de uma ampla gama de ferramentas padrão de programação e desenvolvimento do Linux.
Publico Alvo
Programadores, desenvolvedores e administradores de sistema que precisam construir scripts de shell e processar arquivos de texto usando recursos avançados de manipulação de texto.
O curso Linux Bash Shell Programming pressupõe conhecimento do sistema operacional Linux até o nível abordado no curso de introdução ao Linux. Alguma experiência em programação também pode ser vantajosa.
Materiais
Inglês/Português/Lab Prático
Conteúdo Programatico
COURSE INTRODUCTION
- Administration and Course Materials
- Course Structure and Agenda
- Delegate and Trainer Introductions
UNIX COMMAND REVIEW
- Basic Unix commands
- General commands
- File and directory handling commands
- Filename generation characters
- I/O Redirection features
- Other commands
GETTING STARTED
- What is a shell script?
- Development guidelines
- Creating and editing shell scripts
- Naming and storing shell scripts
- Executing shell scripts
- Exercise: Write a simple shell script
USING VARIABLES
- Environment variables
- Local variables
- Assigning values to variables
- Assessing variable values
- Using quotes
- Delimiting variable names
- Echo control sequences
- Exercise: Add variables to a script
INTEGER ARITHMETIC
- Using the expr command
- Using the (( )) notation
- Exercises: Add integer arithmetic to a shell script
HANDLING RUN TIME DATA
- The read command
- Command line arguments
- Exercise: Writing a generic shell script
- Exercise: Writing an interactive shell script
CONDITIONAL EXECUTION
- The if statement
- The test command
- Exercise: Adding validation to previous scripts
ADDITIONAL KORN,BASH & POSIX SYNTAX
- Other test notations
- Default and substitute variables
- Exit status codes
- Exercise
LOOP CONSTRUCTS
- The while loop
- The until loop
- The for loop
- The while true and until false loops
- Loop control commands
- Exercise: Enhancing the previously written scripts
- Exercise: Writing a script to copy files using a 'for' loop
- Exercise: Writing a script to generate numbers with the 'while' loop
MULTI-BRANCH DECISIONS
- The case statement
- Menu driven applications
- Exercise: Developing and writing a menu system
FUNCTIONS
- What is a function?
- Syntax
- Examples
- Creating a Function Library
- Exercise: Add a function to a script
INTERRUPT HANDLING
- Interrupt signals
- Trapping interrupts
- Exercise: Adding traps to the menu script
ADDITIONAL FEATURES AND FACILITIES
- The exec commands
- The includes notation
- More about loops
- Arrays
- Here Documents
- Exercise: Create a here script
BACKUP AND RESTORE UTILITIES
- Backing-up and restoring files
- Basic and advanced use of tar
- Compression utilities gzip,bzip2,zip and compress
- Exercise: Backing up and restoring files using tar
- Exercises: Compressing files
BACKGROUND JOB SCHEDULING
- Scheduling jobs with the cron command
- Scheduling jobs with the at command
- Exercises: Running background jobs
COMMANDS FOR COMPARING FILES
- Compare files with the cmp command
- Compare and format files with pr
- Compare files with the comm command
- Compare files with the diff and sdiff commands
- Compare large files with the bdiff command
- Exercises: Identifying file differences
SPLITTING FILES
- The fold command
- Split files using context and content rules
- Exercises: Splitting files
IDENTIFYING AND TRANSLATING CHARACTERS
- od - octal dump
- Use cat to display non-printing characters
- View and format files with nl
- The expand and unexpand commands to convert between tab and space characters
- The tr command for character translation
- Exercises: Translating characters with tr
REGULAR EXPRESSION NOTATION REVIEW
- Standard regular expressions
- Searching with grep
- Metacharacters,positional characters and quantifiers
- Extended regular expressions
- POSIX character classes
- PERL expressions
THE STREAM EDITOR SED
- sed command line syntax
- sed script files
- sed command processing
- sed addresses and simple instructions
- sed pattern space and hold space
- Grouping sed commands
- Hold and get functions
- Advanced flow control
- Write output to temporary files
- Exercises: Text processing with sed
FUNDAMENTALS OF AWK
- Basic AWK usage
- AWK program-files
- AWK scripts
- AWK variables
- Pattern matching with AWK
- AWK extended patterns
AWK OPERATORS
- AWK operators
- AWK arithmetic operations
- AWK output
- Formatting output with printf
- Exercises: Create awk scripts to extract selected data from a file and generate reports
AWK PROGRAM CONTROL STRUCTURES
- The BEGIN and END functions
- The AWK if construct
- The AWK else if construct
- The AWK while construct
- Other program control statements
- The AWK break,continue and exit statements
- User defined functions
- Exercises: Create AWK scripts and program-files utilising program control structures
AWK FUNCTIONS
- AWK string functions
- AWK length,tolower,toupper,index,sub,gsub,match,substr,split,sprintf,system and getline functions
- Exercises: Generate AWK scripts and program-files to extract and format data using AWK functions
AWK ARRAYS
- AWK associative arrays
- Multi-dimensional arrays
- Exercises: Create AWK associative arrays to process text files and generate reports
MISCELLANEOUS TOOLS
- bc (calculator)
- fuser (testing for files in use)
- getops (checking options passed to shell scripts)
- printf (formatting screen output)
- logger (script logging)
- xargs (generating arguments for a command)
- eval (re-evaluating variables)
- Exercises: Using tools within a shell script
TENHO INTERESSE