shell中,\ 等符号的困惑。

shell中,\ 等符号的困惑。

哪位大虾能归纳一下
shell中 \ ^,\\ "",'',``,[-]的用法,不胜感激。谢谢。      
复制内容到剪贴板
代码:
QUOTING
       Quoting is used to remove the special meaning of certain characters  or
       words  to  the shell.  Quoting can be used to disable special treatment
       for special characters, to prevent reserved words from being recognized
       as such, and to prevent parameter expansion.

       Each  of  the metacharacters listed above under DEFINITIONS has special
       meaning to the shell and must be quoted if it is to represent itself.

       When the command history expansion facilities are being used, the  his-
       tory  expansion character, usually !, must be quoted to prevent history
       expansion.

       There are  three  quoting  mechanisms:  the  escape  character,  single
       quotes, and double quotes.

       A  non-quoted  backslash (\) is the escape character.  It preserves the
       literal value of the next character that follows, with the exception of
       <newline>.   If  a  \<newline>  pair  appears, and the backslash is not
       itself quoted, the \<newline> is treated as a line  continuation  (that
       is, it is removed from the input stream and effectively ignored).

       Enclosing  characters  in  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.

       Enclosing  characters  in  double quotes preserves the literal value of
       all characters within the quotes, with the exception of $,  ‘,  and  \.
       The  characters  $  and  ‘  retain  their special meaning within double
       quotes.  The backslash retains its special meaning only  when  followed
       by one of the following characters: $, ‘, ", \, or <newline>.  A double
       quote may be quoted within double quotes by preceding it with  a  back-
       slash.

       The  special  parameters  *  and  @ have special meaning when in double
       quotes (see PARAMETERS below).

       Words of the form $’string’ are treated specially.  The word expands to
       string,  with  backslash-escaped characters replaced as specifed by the
       ANSI C standard.  Backslash escape sequences, if present,  are  decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \e     an escape character
              \f     form feed
              \n     new line
              \r     carriage return
              \t     horizontal tab
              \v     vertical tab
              \\     backslash
              \’     single quote
              \nnn   the  eight-bit  character  whose value is the octal value
                     nnn (one to three digits)
              \xHH   the eight-bit character whose value  is  the  hexadecimal
                     value HH (one or two hex digits)
              \cx    a control-x character

       The  expanded  result  is  single-quoted, as if the dollar sign had not
       been present.

       A double-quoted string preceded by a dollar sign  ($)  will  cause  the
       string  to  be translated according to the current locale.  If the cur-
       rent locale is C or POSIX, the dollar sign is ignored.  If  the  string
       is translated and replaced, the replacement is double-quoted.
      
复制内容到剪贴板
代码:
   Pathname Expansion
       After word splitting, unless the -f option has  been  set,  bash  scans
       each  word  for the characters *, ?, and [.  If one of these characters
       appears, then the word is regarded as a pattern, and replaced  with  an
       alphabetically  sorted  list of file names matching the pattern.  If no
       matching file names are found, and the shell option  nullglob  is  dis-
       abled,  the word is left unchanged.  If the nullglob option is set, and
       no matches are found, the word is removed.  If the shell option nocase-
       glob  is  enabled, the match is performed without regard to the case of
       alphabetic characters.  When a pattern is used for pathname  expansion,
       the  character ‘‘.’’  at the start of a name or immediately following a
       slash must be matched explicitly, unless the shell  option  dotglob  is
       set.   When  matching  a  pathname,  the slash character must always be
       matched explicitly.  In  other  cases,  the  ‘‘.’’   character  is  not
       treated  specially.   See  the  description  of shopt below under SHELL
       BUILTIN COMMANDS for a description of  the  nocaseglob,  nullglob,  and
       dotglob shell options.

       The  GLOBIGNORE  shell variable may be used to restrict the set of file
       names matching a pattern.  If GLOBIGNORE is  set,  each  matching  file
       name  that  also  matches  one of the patterns in GLOBIGNORE is removed
       from the list of matches.  The file names ‘‘.’’  and ‘‘..’’  are always
       ignored,  even when GLOBIGNORE is set.  However, setting GLOBIGNORE has
       the effect of enabling the dotglob shell  option,  so  all  other  file
       names  beginning  with a ‘‘.’’  will match.  To get the old behavior of
       ignoring file names beginning with a ‘‘.’’, make  ‘‘.*’’   one  of  the
       patterns in GLOBIGNORE.  The dotglob option is disabled when GLOBIGNORE
       is unset.

       Pattern Matching

       Any character that appears in a pattern, other than the special pattern
       characters  described below, matches itself.  The NUL character may not
       occur in a pattern.  The special pattern characters must be  quoted  if
       they are to be matched literally.

       The special pattern characters have the following meanings:

       *      Matches any string, including the null string.
       ?      Matches any single character.
       [...]  Matches  any  one of the enclosed characters.  A pair of charac-
              ters separated by a hyphen denotes a range expression; any char-
              acter  that sorts between those two characters, inclusive, using
              the current locale’s collating sequence and  character  set,  is
              matched.   If the first character following the [ is a !  or a ^
              then any character not enclosed is matched.  The  sorting  order
              of  characters in range expressions is determined by the current
              locale and the value of the LC_COLLATE shell variable,  if  set.
              A  - may be matched by including it as the first or last charac-
              ter in the set.  A ] may be matched by including it as the first
              character in the set.

              Within  [  and  ],  character classes can be specified using the
              syntax [:class:], where class is one of  the  following  classes
              defined in the POSIX.2 standard:
              alnum  alpha  ascii  blank  cntrl  digit graph lower print punct
              space upper word xdigit
              A character class matches any character belonging to that class.
              The  word character class matches letters, digits, and the char-
              acter _.

              Within [ and ], an equivalence class can be specified using  the
              syntax  [=c=], which matches all characters with the same colla-
              tion weight (as defined by the current locale) as the  character
              c.

              Within [ and ], the syntax [.symbol.] matches the collating sym-
              bol symbol.

       If the extglob shell option is enabled using the shopt builtin, several
       extended  pattern  matching operators are recognized.  In the following
       description, a pattern-list is a list of one or more patterns separated
       by a |.  Composite patterns may be formed using one or more of the fol-
       lowing sub-patterns:

              ?(pattern-list)
                     Matches zero or one occurrence of the given patterns
              *(pattern-list)
                     Matches zero or more occurrences of the given patterns
              +(pattern-list)
                     Matches one or more occurrences of the given patterns
              @(pattern-list)
                     Matches exactly one of the given patterns
              !(pattern-list)
                     Matches anything except one of the given patterns