...
Standard streams
As described Intro Unix: Standard streams and redirection each with a well-defined stream number:
...
Code Block | ||
---|---|---|
| ||
~/workshop/step_01.sh helloWorld My name is Anna | tee step_01.log |
See Standard streams and piping in the Intro Unix wiki.
When standard output and standard error streams are used
...
- Starts automatic logging to a log file named using its 1st logFileTag argument, by calling the auto_log function.
- Uses echo -e where the -e argument to echo enables interpretation of backslash escapes.
- e.g. "\t" as a tab Tab character and "\n" will be interpreted as a newline.
- Calls stdStreams with its 2nd and 3rd arguments.
- Calls echo capturing its output in a local variable using backtick execution syntax, then displays the captured text.
- Calls the echo_se function with some text.
- Calls the echo_se function again, capturing its output in a local variable, then displays the captured text.
...
Expand | ||
---|---|---|
| ||
Because backtick evaluation replaces the command in backticks ( `...` ) with the echo command's standard output. |
...
Expand | ||
---|---|---|
| ||
The log file produced is autoLog_test1.log, written to the current directory in force when step_02.sh was called. This name is based on the logFileTag we specified as "test1". Its contents (below) are nearly the same as when
|
...