/usr/bin/bash: Difference between revisions

 
Line 1,892: Line 1,892:


=== Modifiers ===
=== Modifiers ===
After the optional word designator, there may appear a sequence of one or more of  the  following modifiers,  each  preceded  by a `:'.  These modify, or edit, the word or words selected from the history event.
オプションの単語指示子の後には、それぞれ`:'で始まる1つ以上の修飾子が現れる。 これらは、履歴イベントから選択された単語を修正する。


;h
;h
:Remove a trailing filename component, leaving only the head.
:末尾のファイル名コンポーネントを削除し、先頭だけを残す。
;t
;t
:Remove all leading filename components, leaving the tail.
:ファイル名の先頭をすべて削除し、末尾を残す。
;r
;r
:Remove a trailing suffix of the form .xxx, leaving the basename.
:.xxx 形式の末尾のサフィックスを削除し、ベース名を残す。
;e
;e
:Remove all but the trailing suffix.
:末尾の接尾辞以外はすべて削除する。
;p
;p
:Print the new command but do not execute it.
:新しいコマンドを表示するが、実行はしない。
;q
;q
:Quote the substituted words, escaping further substitutions.
:置換された単語を引用し、それ以上の置換を避ける。
;x
;x
:Quote the substituted words as with q, but break into words at blanks and newlines.  The q and x modifiers are mutually exclusive; the last one supplied is used.
:qと同様に置換された単語を引用するが、空白と改行で単語を区切る。 q修飾子とx修飾子は互いに排他的であり、最後に与えられたものが使われる。
;s/old/new/
;s/old/new/
:Substitute  new  for  the first occurrence of old in the event line.  Any character may be used as the delimiter in place of /.  The final delimiter is optional if it  is  the  last character  of  the  event  line.  The delimiter may be quoted in old and new with a single backslash.  If & appears in new, it is replaced by old.  A single backslash will quote the &.  If old is null, it is set to the last old substituted, or, if no previous history substitutions took place, the last string in a !?string[?] search.  If  new  is  null,  each matching old is deleted.
:イベント行で最初に出現するoldをnewに置き換える。 最後のデリミタは、イベント行の最後の文字であれば任意である。 デリミタは、バックスラッシュ1つでoldとnewで引用することができる。 もし&がnewに現れた場合、それはoldに置き換えられる。 シングル・バックスラッシュは&を引用符で囲む。 oldがNULLの場合、最後に置換されたoldに設定され、それ以前に履歴の置換が行われなかった場合は、!?string[?]検索の最後の文字列に設定される。 newがNULLの場合、一致するoldはすべて削除される。
;&
;&
:Repeat the previous substitution.
:前の置換を繰り返す。
;g
;g
:Cause  changes to be applied over the entire event line.  This is used in conjunction with `:s' (e.g., `:gs/old/new/') or `:&'.  If used with `:s', any  delimiter  can  be  used  in place  of  /, and the final delimiter is optional if it is the last character of the event line.  An a may be used as a synonym for g.
:変更をイベント行全体に適用する。 これは `:s' (例えば `:gs/old/new/') または `:&' と組み合わせて使う。 s' と一緒に使う場合、/の代わりにどんな区切り文字でも使うことができ、最後の区切り文字がイベント行の最後の文字であれば省略可能である。 gの同義語としてaを使うこともできる。
;G
;G
:Apply the following `s' or `&' modifier once to each word in the event line.
:以下の`s'または`&'修飾子をイベント行の各単語に1回ずつ適用する。


== SHELL BUILTIN COMMANDS ==
== SHELL BUILTIN COMMANDS ==