/usr/bin/bash: Difference between revisions

Line 2,500: Line 2,500:
::Signal the end of options, cause all remaining args to be assigned  to  the  positional  parameters.  The -x and -v options are turned off.  If there are no args, the positional parameters remain unchanged.
::Signal the end of options, cause all remaining args to be assigned  to  the  positional  parameters.  The -x and -v options are turned off.  If there are no args, the positional parameters remain unchanged.


:The options are off by default unless otherwise noted.  Using + rather than - causes these options to be turned off.  The options can also be specified as arguments to an invocation of the shell.  The current set of options may be found in $-.  The return status is always true unless an invalid option is encountered.
:特に断りのない限り、オプションはデフォルトでオフになっている。 ではなく+を使用すると、これらのオプションはオフになる。 オプションは、シェルを起動する際の引数として指定することもできる。 現在のオプションのセットは $- にある。 無効なオプションに遭遇しない限り、戻り値は常に真である。


;<nowiki>shift [n]</nowiki>
;<nowiki>shift [n]</nowiki>
:The  positional  parameters from n+1 ... are renamed to $1 ....  Parameters represented by the numbers $# down to $#-n+1 are unset.  n must be a non-negative  number  less  than  or equal  to $#.  If n is 0, no parameters are changed.  If n is not given, it is assumed to be 1.  If n is greater than $#, the positional parameters are  not  changed.  The  return status is greater than zero if n is greater than $# or less than zero; otherwise 0.
:n+1 ...までの位置パラメーターは$1 ...に改名される。 nは、$#以下の非負の数でなければならない。 nが0の場合、パラメーターは変更されない。 nが与えられない場合、1とみなされる。 nが$#より大きい場合、位置パラメーターは変更されない。 戻り値は、nが$#より大きいか0より小さい場合は0より大きく、それ以外は0である。


;<nowiki>shopt [-pqsu] [-o] [optname ...]</nowiki>
;<nowiki>shopt [-pqsu] [-o] [optname ...]</nowiki>
:Toggle  the  values  of settings controlling optional shell behavior.  The settings can be either those listed below, or, if the -o option is used, those available with the  -o option  to  the  set builtin command.  With no options, or with the -p option, a list of all settable options is displayed, with an indication of whether or not each is set;  if  optnames  are supplied, the output is restricted to those options.  The -p option causes output to be displayed in a form that may be reused as input.  Other options have the following meanings:
:オプションのシェル動作を制御する設定の値を切り替える。 設定値は、以下に列挙するものか、-o オプションを使用した場合は set 組み込みコマンドの -o オプションで使用可能なものである。 オプションなし、または -p オプションを指定すると、設定可能なすべてのオプションのリストが表示され、それぞれが設定されているかどうかが示される。 -pオプションを指定すると、入力として再利用できる形式で出力が表示される。 その他のオプションの意味は以下のとおりである:
:;-s
:;-s
::Enable (set) each optname.
::それぞれのoptnameを有効にする(設定する)。
:;-u
:;-u
::Disable (unset) each optname.
::optname を無効にする(設定解除する)。
:;-q
:;-q
::Suppresses normal output (quiet mode); the return status indicates whether the optname is set or unset.  If multiple optname arguments are given with -q, the  return status is zero if all optnames are enabled; non-zero otherwise.
::通常の出力を抑制する(クワイエットモード)。戻り値は、optnameが設定されているか否かを示す。 複数のoptname引数を-qで指定した場合、すべてのoptnameが有効になっていれば戻り値は0であり、そうでなければ0ではない。
:;-o
:;-o
::Restricts  the  values  of optname to be those defined for the -o option to the set builtin.
::optnameの値を、setビルトインの-oオプションで定義された値に制限する。


:If either -s or -u is used with no optname arguments, shopt shows only those options which are  set  or  unset, respectively.  Unless otherwise noted, the shopt options are disabled (unset) by default.
:optname引数を指定せずに-sまたは-uを使用した場合、shoptはそれぞれ設定または未設定のオプションのみを表示する。 特に断りのない限り、shoptのオプションはデフォルトで無効(未設定)になっている。


:The return status when listing options is zero if all optnames are enabled, non-zero  otherwise.  When setting or unsetting options, the return status is zero unless an optname is not a valid shell option.
:オプションを一覧表示するときの戻りステータスは、すべての optname が有効な場合は 0 であり、そうでない場合は 0 以外である。 オプションを設定または解除する場合、optnameが有効なシェルオプションでない場合を除き、戻り値は0である。


:ショップオプションのリストは以下の通り:
:ショップオプションのリストは以下の通り: