Friday, 20 April 2007

regular_expression

Shell Metacharacters: Special characters are interpreted by the shell for expansion unless they are quoted or escaped
  • * metacharacter means any srtings of zero or more characters, eg *.*,
  • ? matches any single character
  • [] matches any of the eclosed charcter. [a-z] or [!abc]
  • ` substitutes the output of a command.


Avoiding Shell Expansion: The character needs to be quoted or escaped

quoted:

  • "" everything between " and " is taken literally, except for : $ ` ' " .
  • '' everything between ' and ' is taken literally except for ' . we can embed another ' within a pare of ' using escaping.


Escaped: using \

  • The character following a backslash \ is taken literally.
  • Use \ within ″ ″ or ’ ’ to escape ″, $, and ′ when necessary.

p11

No comments: