/usr/bin/dash: Difference between revisions

Line 546: Line 546:


=== Shell Patterns ===
=== Shell Patterns ===
    A pattern consists of normal characters, which match themselves, and meta-characters.  The meta-char‐
パターンは、それ自体にマッチする通常の文字と、メタ文字で構成される。 メタ文字は、<nowiki>"!"、"*"、"?"、"["</nowiki>である。 これらの文字は,引用符で囲むと特別な意味を失う。
    acters are “!”, “*”, “?”, and “[”.  These characters lose their special meanings if they are quoted.
コマンドや変数の置換が行われ、ドル記号やバッククォートが二重引用符で囲まれていない場合、変数の値やコマンドの出力がこれらの文字をスキャンし、それらはメタ文字に変わる。
    When command or variable substitution is performed and the dollar sign or back quotes are not double
    quoted, the value of the variable or the output of the command is scanned for these characters and
    they are turned into meta-characters.


    An asterisk (“*”) matches any string of characters.  A question mark matches any single character.  A
アスタリスク<nowiki>("*")</nowiki>は、任意の文字列と一致する。 クエスチョンマークは、任意の1文字にマッチする。 左括弧<nowiki>("[")</nowiki>は、文字クラスを導入する。 文字クラスの終わりは<nowiki>("]")</nowiki>で示される。<nowiki>"]"</nowiki>がない場合、<nowiki>"["</nowiki>は文字クラスを導入するのではなく、<nowiki>"["</nowiki>にマッチする。 文字クラスは,角括弧の間の任意の文字にマッチする。 マイナス記号で文字の範囲を指定することもできる。 感嘆符を文字クラスの最初の文字とすることで,文字クラスを補完することができる。
    left bracket ([) introduces a character class.  The end of the character class is indicated by a
    (]); if the “]” is missing then the “[” matches a “[” rather than introducing a character class.  A
    character class matches any of the characters between the square brackets.  A range of characters may
    be specified using a minus sign.  The character class may be complemented by making an exclamation
    point the first character of the character class.


    To include a “]” in a character class, make it the first character listed (after the “!”, if any).  To
文字クラスに<nowiki>"]"</nowiki>を含めるには,(もしあれば<nowiki>"!"</nowiki>の後に)最初にリストされる文字にする。 マイナス記号を含めるには、最初か最後の文字にする。
    include a minus sign, make it the first or last character listed.


=== Builtins ===
=== Builtins ===