Commit fc020208 authored by Tilman Kranz's avatar Tilman Kranz

summary wording changes

parent c0eaebbe
#!/bin/sh
# Examples of indenting code blocks.
# Indenting code blocks.
# @Test
idle_secs=3
......
#!/bin/sh
# Example of line continuations.
# Breaking long lines with continuations.
# @Test
path="${1:-.}"
......
#!/bin/sh
# Example for assignment of values.
# Assigning values to variables.
# @Test
# Example for appending to a variable.
......
#!/bin/sh
# Example for here-documents using shell quoting mechanisms.
# Generating output using quoting or here-documents.
# Note: The sample output was generated with
# echo foobar | figlet
# @Test single-quote
......
# Example of sourced file.
# Example file for inclusing with `source`.
# shellcheck disable=SC2148
export CONF_LOGFILE='/tmp/shellscripts.log'
......
# Example of a sourced file.
# Example file for inclusing with `source`.
# shellcheck disable=SC2148
debug() {
......
#!/bin/sh
# Example of sourcing a file.
# Including script cose from external files using `source`.
# shellcheck disable=1090,2016
dir=$(dirname "$0")
......
#!/bin/sh
# Example of using a function's return value.
# Evaluating a function's return value.
# Filter with return value 0 if no match, 1 otherwise.
word_filter_2() {
......
#!/bin/sh
# Example of a function providing the last foreground status as return value.
# Providing the last foreground status as return value.
# Filter, providing the return value of grep.
word_filter_3() {
......
#!/bin/sh
# Example of variable assignments and their visibility.
# Visibility of variables.
echo "Example 1.1: Assign, then use."
FOO=bar
......
#!/bin/sh
# Example for loops without and with implicit subshell.
# Loops without and with implicit subshell.
# shellcheck disable=SC2030,SC2031
echo "Example 2.1: Use variable in main program."
......
#!/bin/bash
# Example of quoting command arguments.
# Quoting command arguments.
# shellcheck disable=SC2086
path="${1:-.}"
......
#!/bin/sh
# Examples of evaluating the commandline arguments of a script,
# * using special parameters $* and $@,
# * with and without quotes,
# * selected examples with modified IFS.
# Evaluating the commandline arguments of a script.
name=$(basename "$0" .sh)
dir=$(readlink -f "$(dirname "$0")")
......
#!/bin/sh
# Example on how to assign defaults to variables if the correpsonding parameters are unset.
# Assigning defaults to variables.
path_default="$PWD"
arg_default="build"
......
#!/bin/bash
# Example using sed and Bash arrays to parse single-letter-options.
# Using sed and Bash arrays to parse single-letter-options.
# @Test -foo bar
# Enable extended patterns.
......
#!/bin/sh
# Example of how to use terminal escape sequences for text attributes.
# Using terminal escape sequences for text attributes.
# Determine terminal escape sequences according to TERM if possible and available.
# Sets global variables BOLD, DIM, RED, OFF (sequences) and FALLBACK (true|false).
......
#!/bin/sh
# Example for using carriage return on UNIX terminals.
# Using carriage return on UNIX terminals.
if ! test -t 1 ; then
echo "Not connected to a terminal, exiting." >&2
......
#!/bin/sh
# Examples of awk replacing textutils for common tasks.
# Using AWK and sed instead of textutils for common tasks.
# wc -l
wc_l() {
......
#!/bin/sh
# Using AWK to display complex information formatting.
# A complex AWK program.
# A directory hierarchy is displayed in tabular format.
# Usage: showdir [FIND_ARGUMENTS]
# Arguments: See find(1).
......
#!/bin/sh
# Example for exit event handler.
# Setting up an exit event handler.
rv="${1:-1}"
......
#!/bin/sh
# Example for UNIX signal handler.
# Setting up a UNIX signal handler.
on_sigusr1() {
echo SIGUSR1 in PID: $$ >&2
......
......@@ -6,15 +6,15 @@ Table of Contents
### 1 [Basics](./01-basics/)
* 1.1 [Indentation](./01-basics/1-indentation.sh)
Examples of indenting code blocks.
Indenting code blocks.
* 1.2 [Continuation](./01-basics/2-continuation.sh)
Example of line continuations.
Breaking long lines with continuations.
* 1.3 [Arithmetics](./01-basics/3-arithmetics.bash)
Example of performing arithmetics.
* 1.4 [Assignments](./01-basics/4-assignments.sh)
Example for assignment of values.
Assigning values to variables.
* 1.5 [Quoting](./01-basics/5-quoting.sh)
Example for here-documents using shell quoting mechanisms.
Generating output using quoting or here-documents.
* 1.6 [Return Values](./01-basics/6-return-values.sh)
Discarding and considering return values.
* 1.7 [Shell Options](./01-basics/7-shell-options.sh)
......@@ -25,7 +25,7 @@ Table of Contents
### 2 [Sourcing](./02-sourcing/)
* 2.1 [Dynamic Sourcing](./02-sourcing/1-dynamic-sourcing.sh)
Example of sourcing a file.
Including script cose from external files using `source`.
### 3 [Functions](./03-functions/)
* 3.1 [Subprogram](./03-functions/1-subprogram.sh)
......@@ -35,28 +35,28 @@ Table of Contents
* 3.3 [Filter](./03-functions/3-filter.sh)
Filter stdin to stdout, report on stderr.
* 3.4 [Return Value](./03-functions/4-return-value.sh)
Example of using a function's return value.
Evaluating a function's return value.
* 3.5 [Last Foreground Pipeline](./03-functions/5-last-foreground-pipeline.sh)
Example of a function providing the last foreground status as return value.
Providing the last foreground status as return value.
* 3.6 [Arguments](./03-functions/6-arguments.sh)
Iterate function arguments.
* 3.7 [Exercises](./03-functions/7-exercises.md)
### 4 [Variables](./04-variables/)
* 4.1 [Assignments](./04-variables/1-assignments.sh)
Example of variable assignments and their visibility.
Visibility of variables.
* 4.2 [Local Assignments](./04-variables/2-local-assignments.bash)
Example of local variables in Bash.
* 4.3 [Loops](./04-variables/3-loops.sh)
Example for loops without and with implicit subshell.
Loops without and with implicit subshell.
* 4.4 [Arguments](./04-variables/4-arguments.sh)
Example of quoting command arguments.
Quoting command arguments.
* 4.5 [Parameters](./04-variables/5-parameters.sh)
Examples of evaluating the commandline arguments of a script,
Evaluating the commandline arguments of a script.
* 4.6 [Defaults](./04-variables/6-defaults.sh)
Example on how to assign defaults to variables if the correpsonding parameters are unset.
Assigning defaults to variables.
* 4.7 [Option Parsing](./04-variables/7-option-parsing.sh)
Example using sed and Bash arrays to parse single-letter-options.
Using sed and Bash arrays to parse single-letter-options.
* 4.8 [Exercises](./04-variables/8-exercises.md)
### 5 [Redirection](./05-redirection/)
......@@ -81,11 +81,11 @@ Table of Contents
### 7 [Terminal](./07-terminal/)
* 7.1 [Text Attributes](./07-terminal/1-text-attributes.sh)
Example of how to use terminal escape sequences for text attributes.
Using terminal escape sequences for text attributes.
* 7.2 [Positioning](./07-terminal/2-positioning.sh)
shellcheck disable=SC2034
* 7.3 [Carriage Return](./07-terminal/3-carriage-return.sh)
Example for using carriage return on UNIX terminals.
Using carriage return on UNIX terminals.
* 7.4 [Exercises](./07-terminal/4-exercises.md)
### 8 [Powertools](./08-powertools/)
......@@ -98,16 +98,16 @@ Table of Contents
* 8.2 [Head](./08-powertools/2-head.sh)
Print up to the frist two lines of very plain file fount in /tmp.
* 8.3 [Textutils Replacements](./08-powertools/3-textutils-replacements.sh)
Examples of awk replacing textutils for common tasks.
Using AWK and sed instead of textutils for common tasks.
* 8.4 [Showdir (AWK version)](./08-powertools/4-showdir.awk.sh)
Using AWK to display complex information formatting.
A complex AWK program.
* 8.5 [Exercises](./08-powertools/5-exercises.md)
### 9 [Trap](./09-trap/)
* 9.1 [EXIT](./09-trap/1-exit.sh)
Example for exit event handler.
Setting up an exit event handler.
* 9.1 [SIGUSR1](./09-trap/2-usr1.sh)
Example for UNIX signal handler.
Setting up a UNIX signal handler.
* 9.3 [Exercises](./09-trap/3-exercises.md)
### 0 [Completion](./10-completion/)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment