Linux Shell Scripting Tutorial (LSST) v2.0
Una interessante guida per apprendere al meglio il bash scripting è possibile trovarla anche nel sito della nixcraft (registrandosi gratuitamente potete staricare anche la versione PDF ).
Il sommario è questo.
Chapter 1: Quick Introduction to Linux
- What Is Linux?
- Who created Linux?
- Where can I download Linux?
- How do I Install Linux?
- Linux usage in everyday life
- What is Linux Kernel?
- What is Linux Shell?
- Unix philosophy
- But how do you use the shell?
- What is a Shell Script or shell scripting?
- Why shell scripting?
- Chapter 1 Challenges
Chapter 2: Getting Started With Shell Programming
- The bash shell
- Shell commands
- The role of shells in the Linux environment
- Other standard shells
- Write a simple shell script – “Hello World!”
- Chapter 2 Challenges
Chapter 3:The Shell Variables and Environment
- Variables in shell
- Perform arithmetic operations
- Bash variable existence check
- Customize the bash shell environments
- Chapter 3 Challenges
Chapter 4: Conditionals Execution (Decision Making)
- Bash structured language constructs
- Test command
- if structures to execute code based on a condition
- If..else..fi
- Nested ifs
- Multilevel if-then-else
- The exit status of a command
- Conditional execution
- Logical AND &&
- Logical OR ||
- Logical Not !
- Conditional expression using [ (portable version)
- Conditional expression using [[
- Numeric comparison
- String comparison
- File attributes comparisons
- Shell command line parameters
- The case statement
- Chapter 4 Challenges
Chapter 5: Bash Loops
- The for loop statement
- Nested for loop statement
- The while loop statement
- The until loop statement
- The select loop statement
- Using the break statement
- Using the continue statement
- Command substitution
- Chapter 5 Challenges
Chapter 6: Shell Redirection
- Input and Output
- Standard input
- Standard output
- Standard error
- Empty file creation
- /dev/null discards unwanted output
- here documents
- here strings
- Redirection of standard error
- Redirection of standard output
- Appending redirected output
- Redirection of both standard error and output
- Writing output to files
- Assigns the file descriptor (fd) to file for output
- Assigns the file descriptor (fd) to file for input
- Closes the file descriptor (fd)
- Opening the file descriptors for reading and writing
- Reads from the file descriptor (fd)
- Executes commands and send output to the file descriptor (fd)
- Chapter 6 Challenges
Chapter 7: Pipes and Filters
Chapter 8: Traps
- Signals
- The trap statement
- How to clear trap
- Include trap statements in a script
- Use the trap statement to catch signals and handle errors
- What is a Subshell?
- Chapter 8 Challenges
Chapter 9: Functions
- Writing your first shell function
- Defining functions
- Writing functions
- Calling functions
- Pass arguments into a function
- Returning from a function
- Shell functions library
- Recursive function
- Putting functions in background
- Chapter 9 Challenges