Friday 25 June 2010

Using quotes in Bash

This is probably incomplete, the quote in bash has the following usage:

  • Single Quotes (') -  preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
    • e.g. echo '\"This Text is writing between two single quotes! $User' will return the original sentence: \"This Text is writing between two single quotes! $User
  • Double Quotes (") - preserves the literal value of all characters within the quotes, with the exception of `$'``', and `\'.
    • e.g. echo '\"This Text is writing between two single quotes! $User' will return the sentence: "This Text is writing between two single quotes! Yi


A good Bash scripting tutorial, I need to come back and read it!

No comments:

Post a Comment