|
|
Line 2,092: |
Line 2,092: |
|
| |
|
| ;<nowiki>continue [n]</nowiki> | | ;<nowiki>continue [n]</nowiki> |
| :Resume the next iteration of the enclosing for, while, until, or select loop. If n is specified, resume at the nth enclosing loop. n must be ≥ 1. If n is greater than the number of enclosing loops, the last enclosing loop (the ``top-level'' loop) is resumed. The return value is 0 unless n is not greater than or equal to 1. | | :for、while、until、またはselectループの次の反復を再開する。 nが指定された場合、n番目のループで再開する。 nがループの数より大きい場合、最後のループ(``トップレベル''ループ)が再開される。nが1以上でなければ、戻り値は0である。 |
|
| |
|
| ;<nowiki>declare [-aAfFgiIlnrtux] [-p] [name[=value] ...]</nowiki> | | ;<nowiki>declare [-aAfFgiIlnrtux] [-p] [name[=value] ...]</nowiki> |
| ;<nowiki>typeset [-aAfFgiIlnrtux] [-p] [name[=value] ...]</nowiki> | | ;<nowiki>typeset [-aAfFgiIlnrtux] [-p] [name[=value] ...]</nowiki> |
| Declare variables and/or give them attributes. If no names are given then display the values of variables. The -p option will display the attributes and values of each name. When -p is used with name arguments, additional options, other than -f and -F, are ignored. When -p is supplied without name arguments, it will display the attributes and values of all variables having the attributes specified by the additional options. If no other options are supplied with -p, declare will display the attributes and values of all shell variables. The -f option will restrict the display to shell functions. The -F option inhibits the display of function definitions; only the function name and attributes are printed. If the extdebug shell option is enabled using shopt, the source file name and line number where each name is defined are displayed as well. The -F option implies -f. The -g option forces variables to be created or modified at the global scope, even when declare is executed in a shell function. It is ignored in all other cases. The -I option causes local variables to inherit the attributes (except the nameref attribute) and value of any existing variable with the same name at a surrounding scope. If there is no existing variable, the local variable is initially unset. The following options can be used to restrict output to variables with the specified attribute or to give variables attributes:
| | :変数を宣言したり、属性を与えたりする。 名前が与えられていない場合は、変数の値を表示する。 -pオプションは、それぞれの名前の属性と値を表示する。-pが名前引数とともに使われた場合、-fと-F以外の追加オプションは無視される。 名前引数なしで -p を指定すると、追加オプションで指定された属性を持つすべての変数の属性と値が表示される。 他のオプションが -p とともに与えられない場合、 declare はすべてのシェル変数の属性と値を表示する。 -f オプションは、表示をシェル関数に限定する。 -F オプションは関数定義の表示を禁止し、関数名と属性のみが表示される。 shoptを使用してextdebugシェル・オプションを有効にすると、各名称が定義されているソース・ファイル名と行番号も表示される。 -F オプションは -f を意味する。 gオプションは、declareがシェル関数の中で実行された場合でも、変数をグローバル・スコープで作成または変更することを強制する。 それ以外の場合は無視される。 -Iオプションは、ローカル変数の属性(nameref属性を除く)と値を、周囲のスコープに存在する同名の変数に継承させる。 既存の変数がない場合、ローカル変数は初期状態で設定されない。 以下のオプションを使うと、指定した属性を持つ変数に出力を制限したり、変数に属性を与えたりすることができる: |
| :;-a | | :;-a |
| :::Each name is an indexed array variable (see Arrays above). | | :::各名称はインデックス付き配列変数である(上記の「[[#Arrays|Arrays ]]」を参照)。 |
| :;-A | | :;-A |
| ::Each name is an associative array variable (see Arrays above). | | ::それぞれの名前は連想配列変数である(上記の「[[#Arrays|Arrays ]]」を参照)。 |
| :;-f | | :;-f |
| ::Use function names only. | | ::関数名のみを使用する。 |
| :;-i | | :;-i |
| ::The variable is treated as an integer; arithmetic evaluation (see ARITHMETIC EVALUATION above) is performed when the variable is assigned a value. | | ::変数は整数として扱われ、変数に値が代入されると算術評価(上記のARITHMETIC EVALUATIONを参照)が行われる。 |
| :;-l | | :;-l |
| ::When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled. | | ::変数に値が代入されると、大文字はすべて小文字に変換される。 大文字属性は無効になる。 |
| :;-n | | :;-n |
| ::Give each name the nameref attribute, making it a name reference to another variable. That other variable is defined by the value of name. All references, assignments, and attribute modifications to name, except those using or changing the -n attribute itself, are performed on the variable referenced by name's value. The nameref attribute cannot be applied to array variables. | | ::それぞれのnameにnameref属性を与え、別の変数への名前参照とする。 その別の変数は name の値によって定義される。 nameに対するすべての参照、代入、属性の変更は、-n属性そのものを使用または変更するものを除き、nameの値によって参照される変数に対して実行される。 nameref属性は配列変数には適用できない。 |
| :;-r | | :;-r |
| ::Make names readonly. These names cannot then be assigned values by subsequent assignment statements or unset. | | ::名前を読み取り専用にする。 これらの名前は、その後の代入文やアンセットによって値を代入することはできない。 |
| :;-t | | :;-t |
| ::Give each name the trace attribute. Traced functions inherit the DEBUG and RETURN traps from the calling shell. The trace attribute has no special meaning for variables. | | ::それぞれの名前に trace 属性を与える。 トレースされた関数は、呼び出し元のシェルから DEBUG と RETURN トラップを継承する。 trace 属性は変数に対して特別な意味を持たない。 |
| :;-u | | :;-u |
| ::When the variable is assigned a value, all lower-case characters are converted to upper-case. The lower-case attribute is disabled. | | ::変数に値が代入されると、小文字はすべて大文字に変換される。 小文字属性は無効になる。 |
| :;-x | | :;-x |
| ::Mark names for export to subsequent commands via the environment. | | ::環境を通して後続のコマンドにエクスポートする名前をマークする。 |
|
| |
|
| :Using `+' instead of `-' turns off the attribute instead, with the exceptions that +a and +A may not be used to destroy array variables and +r will not remove the readonly attribute. When used in a function, declare and typeset make each name local, as with the local command, unless the -g option is supplied. If a variable name is followed by =value, the value of the variable is set to value. When using -a or -A and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using ``-f foo=bar'', an attempt is made to assign a value to a readonly variable, an attempt is made to assign a value to an array variable without using the compound assignment syntax (see Arrays above), one of the names is not a valid shell variable name, an attempt is made to turn off readonly status for a readonly variable, an attempt is made to turn off array status for an array variable, or an attempt is made to display a non-existent function with -f. | | :ただし、+aや+Aは配列変数を破棄するのに使ってはならず、+rはreadonly属性を削除しない。 関数内で使用する場合、-gオプションが与えられていない限り、declareとtypesetはlocalコマンドと同様に各変数名をローカルにする。 変数名の後に=valueが続くと、その変数の値がvalueに設定される。 -a または -A と複合代入構文を使用して配列変数を作成する場合、追加の属性はそれ以降の代入まで有効にならない。 無効なオプションに出会った場合、``-f foo=bar''を使って関数を定義しようとした場合、 読み取り専用変数に値を代入しようとした場合、複合代入構文を使わずに配列変数に 値を代入しようとした場合(上記の配列を参照)を除いて、戻り値は0である、 名前のいずれかが有効なシェル変数名でない、読み取り専用変数の読み取りステータスをオフにしようとした、配列変数の配列ステータスをオフにしようとした、存在しない関数を -f で表示しようとした。 |
|
| |
|
| ;<nowiki>dirs [-clpv] [+n] [-n]</nowiki> | | ;<nowiki>dirs [-clpv] [+n] [-n]</nowiki> |
| :Without options, displays the list of currently remembered directories. The default display is on a single line with directory names separated by spaces. Directories are added to the list with the pushd command; the popd command removes entries from the list. The current directory is always the first directory in the stack. | | :オプションなしで、現在記憶しているディレクトリのリストを表示する。 デフォルトでは、ディレクトリ名をスペースで区切って1行で表示する。 ディレクトリは pushd コマンドでリストに追加され、 popd コマンドはリストからエントリを削除する。 カレント・ディレクトリは常にスタックの最初のディレクトリである。 |
| :;-c | | :;-c |
| ::Clears the directory stack by deleting all of the entries. | | ::すべてのエントリを削除してディレクトリスタックをクリアする。 |
| :;-l | | :;-l |
| ::Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. | | ::デフォルトのリスト形式では、ホームディレクトリを示すためにチルダを使用する。 |
| :;-p | | :;-p |
| ::Print the directory stack with one entry per line. | | ::ディレクトリスタックを1行1エントリで表示する。 |
| :;-v | | :;-v |
| ::Print the directory stack with one entry per line, prefixing each entry with its index in the stack. | | ::各エントリの先頭にスタック内のインデックスを付けて、1行に1エントリずつディレクトリスタックを表示する。 |
| :;+n | | :;+n |
| ::Displays the nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero. | | ::オプションなしで起動した場合、dirsが表示するリストの左から数えてn番目のエントリーを、ゼロから順に表示する。 |
| :;-n | | :;-n |
| ::Displays the nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero. | | ::オプションなしで起動した場合、dirsが表示するリストの右から数えてn番目のエントリーを、ゼロから順に表示する。 |
|
| |
|
| :The return value is 0 unless an invalid option is supplied or n indexes beyond the end of the directory stack. | | :無効なオプションが与えられるか、n個のインデックスがディレクトリスタッ クの末尾を超えない限り、戻り値は0である。 |
|
| |
|
| ;<nowiki>disown [-ar] [-h] [jobspec ... | pid ... ]</nowiki> | | ;<nowiki>disown [-ar] [-h] [jobspec ... | pid ... ]</nowiki> |