Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Let's look at examples of these.

...

Single and double quotes

First, to see how quoting affects text grouping, we'll use quotes to define some multi-word environment variables.

...

Expand
titleAnswer...

A couple of possibilities: 

Code Block
languagebash
echo 'Backslash character \ is used for escaping'  # Single quotes inhibit metacharacter processing
echo "Backslash character \\ is used for escaping" # Escape the escape character

...


Multi-line text

If you want to output multi-line text, you can:

...

Expand
titleAnswer...

A couple of possibilities: 

Code Block
languagebash
echo 'My
name is
Anna'

echo -e "My\nname\nis\nAnna"

...


Backtick evaluation quoting

backtick ( ` ) evaluation quoting is one of the underappreciated wonders of Unix.

...

You can also specify the tee -a option to append the input text to the file you specify.

The standard error stream

So what's this standard error stream? Recall our discussion of Command input errors? Well, error information is written to standard error, not to standard output!

...