|
|
Line 336: |
Line 336: |
|
| |
|
| === Shell Variables === | | === Shell Variables === |
| The following variables are set by the shell:
| | 以下の変数はシェルによって設定される: |
|
| |
|
| _ At shell startup, set to the pathname used to invoke the shell or shell script being exe‐
| | ;_ |
| cuted as passed in the environment or argument list. Subsequently, expands to the last
| | :シェル起動時に、環境または引数リストで渡された、実行中のシェルまたはシェルスクリプトを呼び出すために使用されるパス名に設定される。 その後、フォアグラウンドで実行される直前の単純なコマンドの lastargument に展開される。 Alsosetは、実行される各コマンドの起動に使われるフルパス名に設定され、 そのコマンドにエクスポートされる環境に置かれる。 メールをチェックする場合、このパラメーターは現在チェックされているメールファイルの名前を保持する。 |
| argument to the previous simple command executed in the foreground, after expansion. Also
| | ;BASH |
| set to the full pathname used to invoke each command executed and placed in the environ‐
| | :このbashのインスタンスを起動するのに使われた完全なファイル名に展開される。 |
| ment exported to that command. When checking mail, this parameter holds the name of the
| | ;BASHOPTS |
| mail file currently being checked.
| | :有効なシェルオプションのコロン区切りリスト。 リストの各単語は、shopt 組み込みコマンドの -s オプションの有効な引数である (下記の [[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]を参照のこと)。'''BASHOPTS'''に表示されるオプションは、shoptが有効であると報告したものである。 bashの起動時にこの変数が環境にあると、起動ファイルを読み込む前にリストの各シェルオプションが有効になる。 この変数は読み取り専用である。 |
| BASH Expands to the full filename used to invoke this instance of bash.
| | ;BASHPID |
| BASHOPTS
| | :現在のbashプロセスのプロセスIDに展開する。 これは、bashの再初期化を必要としないサブシェルなど、特定の状況下では$$とは異なる。 '''BASHPID'''への代入は影響しない。 '''BASHPID'''が未設定の場合、その後にリセットされても、特別なプロパティは失われる。 |
| A colon-separated list of enabled shell options. Each word in the list is a valid argu‐
| | ;BASH_ALIASES |
| ment for the -s option to the shopt builtin command (see SHELL BUILTIN COMMANDS below).
| | :エイリアス組み込み関数が保持するエイリアスの内部リストに対応する連想配列変数。 この配列に追加された要素はエイリアスリストに表示されるが、 現在のところ、配列の要素を設定解除してもエイリアスはエイリアスリストから 削除されない。 '''BASH_ALIASES'''がアンセットされると、その後リセットされてもその特別なプロパティは失われる。 |
| The options appearing in BASHOPTS are those reported as on by shopt. If this variable is
| | ;BASH_ARGC |
| in the environment when bash starts up, each shell option in the list will be enabled be‐
| | :現在のbash実行コールスタックの各フレームのパラメータ数を値とする配列変数。 現在のサブルーチン(.またはsourceで実行されるシェル関数またはスクリプト)のパラメータ数は、スタックの一番上にある。 サブルーチンが実行されると、渡されたパラメータの数が'''BASH_ARGC'''にプッシュされる。 シェルが'''BASH_ARGC'''を設定するのは、拡張デバッグモードのときだけである(以下のshoptビルトインのextdebugオプションの説明を参照)。 シェルがスクリプトの実行を開始した後にextdebugを設定したり、extdebugが設定されていないときにこの変数を参照したりすると、値に矛盾が生じる可能性がある。 |
| fore reading any startup files. This variable is read-only.
| | ;BASH_ARGV |
| BASHPID
| | :現在のbash実行呼び出しスタックのすべてのパラメータを含む配列変数。 最後のサブルーチン呼び出しの最後のパラメータがスタックの一番上にあり、最初の呼び出しの最初のパラメータが一番下にある。 サブルーチンが実行されると、与えられたパラメータが'''BASH_ARGV'''にプッシュされる。 シェルが'''BASH_ARGV'''を設定するのは、拡張デバッグモードのときだけである(下記のshopt組み込み関数へのextdebugオプションの説明を参照のこと)。 シェルがスクリプトの実行を開始した後にextdebugを設定したり、extdebugが設定されていないときにこの変数を参照したりすると、値に矛盾が生じる可能性がある。 |
| Expands to the process ID of the current bash process. This differs from $$ under certain
| | ;BASH_ARGV0 |
| circumstances, such as subshells that do not require bash to be re-initialized. Assign‐
| | :参照されると、この変数はシェルまたはシェルスクリプトの名前に展開される($0と同じ。上記の特別なパラメータ0の説明を参照)。 '''BASH_ARGV0'''に代入すると、代入された値は$0にも代入される。 '''BASH_ARGV0'''が設定されていない場合、その後にリセットされても、特別な性質は失われる。 |
| ments to BASHPID have no effect. If BASHPID is unset, it loses its special properties,
| | ;BASH_CMDS |
| even if it is subsequently reset.
| | :ハッシュ組み込み関数が保持するコマンドの内部ハッシュテーブルに対応するメンバを持つ連想配列変数。 この配列に追加された要素はハッシュテーブルに表示されるが、現在のところ、配列要素の設定を解除してもハッシュテーブルからコマンド名が削除されることはない。 '''BASH_CMDS'''がアンセットされると、その後リセットされても、その特別な特性は失われる。 |
| BASH_ALIASES
| | ;BASH_COMMAND |
| An associative array variable whose members correspond to the internal list of aliases as
| | :シェルがトラップの結果としてコマンドを実行している場合を除き、現在実行中または実行しようとしているコマンドである。 '''BASH_COMMAND'''が設定されていない場合、その後にリセットされても、特別なプロパティは失われる。 |
| maintained by the alias builtin. Elements added to this array appear in the alias list;
| | ;BASH_EXECUTION_STRING |
| however, unsetting array elements currently does not cause aliases to be removed from the
| | :-c起動オプションのコマンド引数。 |
| alias list. If BASH_ALIASES is unset, it loses its special properties, even if it is sub‐
| | ;BASH_LINENO |
| sequently reset.
| | :'''FUNCNAME'''の各メンバが呼び出されたソースファイルの行番号をメンバとする配列変数。 <nowiki>${BASH_LINENO[$i]}</nowiki>は<nowiki>${FUNCNAME[$i]}</nowiki>が呼び出されたソースファイルの行番号<nowiki>(${BASH_SOURCE[$i+1]})</nowiki>である(他のシェル関数内で参照された場合は<nowiki>${BASH_LINENO[$i-1]})</nowiki>。 現在の行番号を得るには'''LINENO'''を使う。 |
| BASH_ARGC
| | ;BASH_LOADABLES_PATH |
| An array variable whose values are the number of parameters in each frame of the current
| | :enableコマンドで指定された動的にロード可能なビルトインをシェルが探すディレクトリのコロン区切りのリスト。 |
| bash execution call stack. The number of parameters to the current subroutine (shell
| | ;BASH_REMATCH |
| function or script executed with . or source) is at the top of the stack. When a subrou‐
| | :二項演算子=~によって<nowiki>[[</nowiki> 条件コマンドにメンバが代入される配列変数。 インデックス0の要素は、正規表現全体にマッチする文字列の部分である。 インデックスnの要素は、n番目の括弧で囲まれた部分式にマッチする文字列の部分である。 |
| tine is executed, the number of parameters passed is pushed onto BASH_ARGC. The shell
| | ;BASH_SOURCE |
| sets BASH_ARGC only when in extended debugging mode (see the description of the extdebug
| | :配列変数'''FUNCNAME'''の対応するシェル関数名が定義されているソースファイル名をメンバとする配列変数である。 シェル関数<nowiki>${FUNCNAME[$i]}</nowiki>はファイル<nowiki>${BASH_SOURCE[$i]}</nowiki>で定義され、<nowiki>${BASH_SOURCE[$i+1]}</nowiki>から呼び出される。 |
| option to the shopt builtin below). Setting extdebug after the shell has started to exe‐
| | ;BASH_SUBSHELL |
| cute a script, or referencing this variable when extdebug is not set, may result in incon‐
| | :シェルがその環境で実行を開始すると、各サブシェルまたはサブシェル環境内で1ずつ増加する。 初期値は0である。'''BASH_SUBSHELL'''が設定されていない場合、その後にリセットされても、特別なプロパティは失われる。 |
| sistent values.
| | ;BASH_VERSINFO |
| BASH_ARGV
| | :読み取り専用の配列変数で、bashのバージョン情報を保持する。 配列のメンバに割り当てられる値は以下のとおりである: |
| An array variable containing all of the parameters in the current bash execution call
| | ;;<nowiki>BASH_VERSINFO[0]</nowiki> |
| stack. The final parameter of the last subroutine call is at the top of the stack; the
| | ::The major version number (the release). |
| first parameter of the initial call is at the bottom. When a subroutine is executed, the
| | ;;<nowiki>BASH_VERSINFO[1]</nowiki> |
| parameters supplied are pushed onto BASH_ARGV. The shell sets BASH_ARGV only when in ex‐
| | :The minor version number (the version). |
| tended debugging mode (see the description of the extdebug option to the shopt builtin be‐
| | ;;<nowiki>BASH_VERSINFO[2]</nowiki> |
| low). Setting extdebug after the shell has started to execute a script, or referencing
| | ::The patch level. |
| this variable when extdebug is not set, may result in inconsistent values.
| | ;;<nowiki>BASH_VERSINFO[3]</nowiki> |
| BASH_ARGV0
| | ::The build version. |
| When referenced, this variable expands to the name of the shell or shell script (identical
| | ;;<nowiki>BASH_VERSINFO[4]</nowiki> |
| to $0; see the description of special parameter 0 above). Assignment to BASH_ARGV0 causes
| | ::The release status (e.g., beta1). |
| the value assigned to also be assigned to $0. If BASH_ARGV0 is unset, it loses its spe‐
| | ;;<nowiki>BASH_VERSINFO[5]</nowiki> |
| cial properties, even if it is subsequently reset.
| | ::The value of '''MACHTYPE'''. |
| BASH_CMDS
| | ;BASH_VERSION |
| An associative array variable whose members correspond to the internal hash table of com‐
| | :bashのインスタンスのバージョンを表す文字列に展開される。 |
| mands as maintained by the hash builtin. Elements added to this array appear in the hash
| | ;COMP_CWORD |
| table; however, unsetting array elements currently does not cause command names to be re‐
| | :現在のカーソル位置を含む単語の<nowiki>${COMP_WORDS}</nowiki>へのインデックス。 この変数は、プログラマブル補完機能によって呼び出されるシェル関数でのみ使用可能である(下記の[[#Programmable Completion|Programmable Completion ]]を参照のこと)。 |
| moved from the hash table. If BASH_CMDS is unset, it loses its special properties, even
| | ;COMP_KEY |
| if it is subsequently reset.
| | :現在の補完機能を呼び出すために使用されるキー(またはキーシーケンスの最後のキー)。 |
| BASH_COMMAND
| | ;COMP_LINE |
| The command currently being executed or about to be executed, unless the shell is execut‐
| | :現在のコマンドライン。 この変数は、シェル関数とプログラム可能な補完機能によって呼び出される外部コマンドでのみ利用可能である(後述の[[#Programmable Completion|Programmable Completion ]]を参照)。 |
| ing a command as the result of a trap, in which case it is the command executing at the
| | ;COMP_POINT |
| time of the trap. If BASH_COMMAND is unset, it loses its special properties, even if it
| | :現在のコマンドの先頭からの相対的な現在のカーソル位置のインデックス。現在のカーソル位置が現在のコマンドの終端にある場合、この変数の値は <nowiki>${#COMP_LINE}</nowiki>に等しい。 この変数は、シェル関数と、プログラム可能な補完機能によって呼び出される外部コマンドでのみ利用可能である(後述の[[#Programmable Completion|Programmable Completion ]]を参照のこと)。 |
| is subsequently reset.
| | ;COMP_TYPE |
| BASH_EXECUTION_STRING
| | :補完関数が呼ばれる原因となった補完のタイプに対応する整数値を設定する: TABは通常の補完、? は連続したタブの後の補完のリスト、! は部分的な単語補完の選択肢のリスト、@ は単語が未修正の場合の補完のリスト、% はメニュー補完のリストである。 この変数は、シェル関数とプログラム可能な補完機能によって呼び出される外部コマンドでのみ使用できる(後述の[[#Programmable Completion|Programmable Completion ]]を参照)。 |
| The command argument to the -c invocation option.
| | ;COMP_WORDBREAKS |
| BASH_LINENO
| | :readlineライブラリが単語補完を行う際に単語区切り文字として扱う文字の集合。 '''COMP_WORDBREAKS'''が未設定の場合、その後リセットされても、その特別な特性は失われる。 |
| An array variable whose members are the line numbers in source files where each corre‐
| | ;COMP_WORDS |
| sponding member of FUNCNAME was invoked. ${BASH_LINENO[$i]} is the line number in the
| | :現在のコマンドラインの各単語からなる配列変数(下記の配列を参照)。 行は、前述の'''COMP_WORD-BREAKS'''を使用して、readlineが分割するように単語に分割される。 この変数は、プログラム可能な補完機能によって呼び出されるシェル関数でのみ使用可能である(後述の[[#Programmable Completion|Programmable Completion ]]を参照)。 |
| source file (${BASH_SOURCE[$i+1]}) where ${FUNCNAME[$i]} was called (or
| | ;COPROC |
| ${BASH_LINENO[$i-1]} if referenced within another shell function). Use LINENO to obtain
| | :無名コプロセス(上記の「コプロセス」を参照)からの出力と無名コプロセスへの入力のファイル記述子を保持するために作成される配列変数(下記の[[#Coprocesses|Coprocesses ]]を参照)。 |
| the current line number.
| | ;DIRSTACK |
| BASH_LOADABLES_PATH
| | :ディレクトリスタックの現在の内容を格納する配列変数 (下記の「配列」を参照)。 ディレクトリは、dirs 組み込み関数によって表示された順序でスタックに格納される。 この配列変数のメンバに代入することで、スタックに既にあるディレクトリを変更することができるが、ディレクトリの追加と削除には、pushd 組み込み関数と popd 組み込み関数を使用しなければならない。 この変数への代入は、カレント・ディレクトリを変更しない。 '''DIRSTACK''' がアンセットされると、その後にリセットされても、その特別な特性は失われる。 |
| A colon-separated list of directories in which the shell looks for dynamically loadable
| | ;EPOCHREALTIME |
| builtins specified by the enable command.
| | :このパラメータが参照されるたびに、Unixエポック('''[https://manpages.debian.org/bookworm/gawk/time.3am.en.html time]'''(3)を参照)からの秒数がマイクロ秒単位の浮動小数点値として展開される。 '''EPOCHREALTIME'''への代入は無視される。 '''EPOCHREALTIME'''が設定されていない場合、その後にリセットされても、その特別な特性は失われる。 |
| BASH_REMATCH
| | ;EPOCHSECONDS |
| An array variable whose members are assigned by the =~ binary operator to the [[ condi‐
| | :このパラメータが参照されるたびに、Unix エポック ('''[https://manpages.debian.org/bookworm/gawk/time.3am.en.html time]'''(3) 参照) からの秒数に展開される。 '''EPOCHSECONDS''' への代入は無視される。 '''EPOCHSECONDS'''が設定されていない場合、その後にリセットされても、その特別な特性は失われる。 |
| tional command. The element with index 0 is the portion of the string matching the entire
| | ;EUID |
| regular expression. The element with index n is the portion of the string matching the
| | :シェル起動時に初期化される、現在のユーザーの実効ユーザーIDに展開される。 この変数は読み取り専用である。 |
| nth parenthesized subexpression.
| | ;FUNCNAME |
| BASH_SOURCE
| | :現在実行コールスタックにあるすべてのシェル関数の名前を含む配列変数。 インデックス0の要素は、現在実行中のシェル関数の名前である。 一番下の要素(インデックスが一番大きい要素)は "main"である。 この変数は、シェル関数が実行されているときだけ存在する。 '''FUNCNAME'''に代入しても何の効果もない。'''FUNCNAME'''が設定されていない場合、その後にリセットされても、特別な特性は失われる。 |
| An array variable whose members are the source filenames where the corresponding shell
| |
| function names in the FUNCNAME array variable are defined. The shell function ${FUNC‐
| |
| NAME[$i]} is defined in the file ${BASH_SOURCE[$i]} and called from ${BASH_SOURCE[$i+1]}.
| |
| BASH_SUBSHELL
| |
| Incremented by one within each subshell or subshell environment when the shell begins exe‐
| |
| cuting in that environment. The initial value is 0. If BASH_SUBSHELL is unset, it loses
| |
| its special properties, even if it is subsequently reset.
| |
| BASH_VERSINFO
| |
| A readonly array variable whose members hold version information for this instance of
| |
| bash. The values assigned to the array members are as follows:
| |
| BASH_VERSINFO[0] The major version number (the release).
| |
| BASH_VERSINFO[1] The minor version number (the version).
| |
| BASH_VERSINFO[2] The patch level.
| |
| BASH_VERSINFO[3] The build version.
| |
| BASH_VERSINFO[4] The release status (e.g., beta1).
| |
| BASH_VERSINFO[5] The value of MACHTYPE.
| |
| BASH_VERSION
| |
| Expands to a string describing the version of this instance of bash.
| |
| COMP_CWORD
| |
| An index into ${COMP_WORDS} of the word containing the current cursor position. This
| |
| variable is available only in shell functions invoked by the programmable completion fa‐
| |
| cilities (see Programmable Completion below).
| |
| COMP_KEY
| |
| The key (or final key of a key sequence) used to invoke the current completion function.
| |
| COMP_LINE
| |
| The current command line. This variable is available only in shell functions and external
| |
| commands invoked by the programmable completion facilities (see Programmable Completion
| |
| below).
| |
| COMP_POINT
| |
| The index of the current cursor position relative to the beginning of the current command.
| |
| If the current cursor position is at the end of the current command, the value of this
| |
| variable is equal to ${#COMP_LINE}. This variable is available only in shell functions
| |
| and external commands invoked by the programmable completion facilities (see Programmable
| |
| Completion below).
| |
| COMP_TYPE
| |
| Set to an integer value corresponding to the type of completion attempted that caused a
| |
| completion function to be called: TAB, for normal completion, ?, for listing completions
| |
| after successive tabs, !, for listing alternatives on partial word completion, @, to list
| |
| completions if the word is not unmodified, or %, for menu completion. This variable is
| |
| available only in shell functions and external commands invoked by the programmable com‐
| |
| pletion facilities (see Programmable Completion below).
| |
| COMP_WORDBREAKS
| |
| The set of characters that the readline library treats as word separators when performing
| |
| word completion. If COMP_WORDBREAKS is unset, it loses its special properties, even if it
| |
| is subsequently reset.
| |
| COMP_WORDS
| |
| An array variable (see Arrays below) consisting of the individual words in the current
| |
| command line. The line is split into words as readline would split it, using COMP_WORD‐
| |
| BREAKS as described above. This variable is available only in shell functions invoked by
| |
| the programmable completion facilities (see Programmable Completion below).
| |
| COPROC An array variable (see Arrays below) created to hold the file descriptors for output from
| |
| and input to an unnamed coprocess (see Coprocesses above).
| |
| DIRSTACK
| |
| An array variable (see Arrays below) containing the current contents of the directory
| |
| stack. Directories appear in the stack in the order they are displayed by the dirs
| |
| builtin. Assigning to members of this array variable may be used to modify directories
| |
| already in the stack, but the pushd and popd builtins must be used to add and remove di‐
| |
| rectories. Assignment to this variable will not change the current directory. If
| |
| DIRSTACK is unset, it loses its special properties, even if it is subsequently reset.
| |
| EPOCHREALTIME
| |
| Each time this parameter is referenced, it expands to the number of seconds since the Unix
| |
| Epoch (see time(3)) as a floating point value with micro-second granularity. Assignments
| |
| to EPOCHREALTIME are ignored. If EPOCHREALTIME is unset, it loses its special properties,
| |
| even if it is subsequently reset.
| |
| EPOCHSECONDS
| |
| Each time this parameter is referenced, it expands to the number of seconds since the Unix
| |
| Epoch (see time(3)). Assignments to EPOCHSECONDS are ignored. If EPOCHSECONDS is unset,
| |
| it loses its special properties, even if it is subsequently reset.
| |
| EUID Expands to the effective user ID of the current user, initialized at shell startup. This
| |
| variable is readonly.
| |
| FUNCNAME
| |
| An array variable containing the names of all shell functions currently in the execution
| |
| call stack. The element with index 0 is the name of any currently-executing shell func‐
| |
| tion. The bottom-most element (the one with the highest index) is "main". This variable
| |
| exists only when a shell function is executing. Assignments to FUNCNAME have no effect.
| |
| If FUNCNAME is unset, it loses its special properties, even if it is subsequently reset.
| |
|
| |
|
| This variable can be used with BASH_LINENO and BASH_SOURCE. Each element of FUNCNAME has
| | :この変数は'''BASH_LINENO'''と'''BASH_SOURCE'''と一緒に使うことができる。 '''FUNCNAME'''の各要素は'''BASH_LINENO'''とBASH_SOURCEに対応する要素を持ち、コールスタックを記述する。 例えば、<nowiki>${FUNCNAME[$i]}はファイル${BASH_SOURCE[$i+1]}</nowiki>から行番号<nowiki>${BASH_LINENO[$i]}</nowiki>で呼び出された。 呼び出し元ビルトインは、この情報を使用して現在の呼び出しスタックを表示する。 |
| corresponding elements in BASH_LINENO and BASH_SOURCE to describe the call stack. For in‐
| | ;GROUPS |
| stance, ${FUNCNAME[$i]} was called from the file ${BASH_SOURCE[$i+1]} at line number
| | :現在のユーザーがメンバーであるグループのリストを含む配列変数。'''GROUPS'''への代入は無効である。 '''GROUPS'''が設定されていない場合、その後にリセットされても、特別なプロパティは失われる。 |
| ${BASH_LINENO[$i]}. The caller builtin displays the current call stack using this infor‐
| | ;HISTCMD |
| mation.
| | :現在のコマンドの履歴番号、または履歴リストのインデックス。 '''HISTCMD'''への割り当ては無視される。 '''HISTCMD'''が設定されていない場合、その後にリセットされても、特別なプロパティは失われる。 |
| GROUPS An array variable containing the list of groups of which the current user is a member.
| | ;HOSTNAME |
| Assignments to GROUPS have no effect. If GROUPS is unset, it loses its special proper‐
| | :自動的に現在のホスト名に設定される。 |
| ties, even if it is subsequently reset.
| | ;HOSTTYPE |
| HISTCMD
| | :bashが実行されているマシンの種類を一意に表す文字列が自動的に設定される。 デフォルトはシステム依存である。 |
| The history number, or index in the history list, of the current command. Assignments to
| | ;LINENO |
| HISTCMD are ignored. If HISTCMD is unset, it loses its special properties, even if it is
| | :このパラメータが参照されるたびに、シェルはスクリプトまたは関数内の 現在の連続行番号(1から始まる)を表す10進数を代入する。スクリプトや関数の中にない場合、代入される値が意味を持つことは保証されない。 '''LINENO'''が未設定の場合、その後にリセットされても、その特別な特性は失われる。 |
| subsequently reset.
| | ;MACHTYPE |
| HOSTNAME
| | :bashが実行されているシステムの種類を、標準のGNU cpu-company-system形式で完全に表す文字列が自動的に設定される。 デフォルトはシステム依存である。 |
| Automatically set to the name of the current host.
| | ;MAPFILE |
| HOSTTYPE
| | :変数名が与えられていない場合に、mapfile 組み込み関数が読み込んだテキストを保持するために作成される配列変数(下記の[[#Arrays|Arrays ]]を参照)。 |
| Automatically set to a string that uniquely describes the type of machine on which bash is
| | ;OLDPWD |
| executing. The default is system-dependent.
| | :cdコマンドで設定された以前の作業ディレクトリ。 |
| LINENO Each time this parameter is referenced, the shell substitutes a decimal number represent‐
| | ;OPTARG |
| ing the current sequential line number (starting with 1) within a script or function.
| | :getopts組み込みコマンドで処理された最後のオプション引数の値(後述の[[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]を参照)。 |
| When not in a script or function, the value substituted is not guaranteed to be meaning‐
| | ;OPTIND |
| ful. If LINENO is unset, it loses its special properties, even if it is subsequently re‐
| | :getopts組み込みコマンド(下記の[[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]を参照)が処理する次の引数のインデックス。 |
| set.
| | ;OSTYPE |
| MACHTYPE
| | :bashが実行されているオペレーティング・システムを表す文字列が自動的に設定される。 デフォルトはシステム依存である。 |
| Automatically set to a string that fully describes the system type on which bash is exe‐
| | ;PIPESTATUS |
| cuting, in the standard GNU cpu-company-system format. The default is system-dependent.
| | :最も最近実行されたフォアグラウンド・パイプラインのプロセス(単一のコマンドのみを含むことができる)の終了ステータス値のリストを含む配列変数(以下の[[#Arrays|Arrays ]]を参照)。 |
| MAPFILE
| | ;PPID |
| An array variable (see Arrays below) created to hold the text read by the mapfile builtin
| | :シェルの親のプロセスID。 この変数は読み取り専用である。 |
| when no variable name is supplied.
| | ;PWD |
| OLDPWD The previous working directory as set by the cd command.
| | :cdコマンドで設定された現在の作業ディレクトリ。 |
| OPTARG The value of the last option argument processed by the getopts builtin command (see SHELL
| | :RANDOM |
| BUILTIN COMMANDS below).
| | :このパラメータが参照されるたびに、0から32767の間のランダムな整数に展開される。 '''RANDOM'''に値を代入すると、乱数列が初期化(seeds)される。'''RANDOM'''の設定が解除されると、その後リセットされても、その特別な特性は失われる。 |
| OPTIND The index of the next argument to be processed by the getopts builtin command (see SHELL
| | ;READLINE_LINE |
| BUILTIN COMMANDS below).
| | ;READLINE_MARK |
| OSTYPE Automatically set to a string that describes the operating system on which bash is execut‐
| | :bind -x」(後述の[[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]参照)で使用する、readline行バッファ内のマーク(保存された挿入点)の位置。 挿入点とマークの間の文字は、しばしば領域と呼ばれる。 |
| ing. The default is system-dependent.
| | ;READLINE_POINT |
| PIPESTATUS
| | :''bind -x''(下記の[[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]を参照)で使用する。 |
| An array variable (see Arrays below) containing a list of exit status values from the pro‐
| | ;REPLY |
| cesses in the most-recently-executed foreground pipeline (which may contain only a single
| | :引数が与えられない場合、read 組み込みコマンドによって読み込まれた入力行を設定する。 |
| command).
| | ;SECONDS |
| PPID The process ID of the shell's parent. This variable is readonly.
| | :このパラメータが参照されるたびに、シェル起動からの秒数が返される。 '''SECONDS'''に値が代入されている場合、それ以降の参照時に返される値は、代入後の秒数に代入された値を加えたものとなる。 シェル起動時の秒数と現在時刻は、常にシステムクロックに問い合わせて決定される。 '''SECONDS'''が未設定の場合、その後にリセットされても、その特別な特性は失われる。 |
| PWD The current working directory as set by the cd command.
| | ;SHELLOPTS |
| RANDOM Each time this parameter is referenced, it expands to a random integer between 0 and
| | :有効なシェルオプションのコロン区切りのリスト。 リスト内の各単語は、 set 組み込みコマンドの -o オプションの有効な引数である (後述の [[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]] を参照のこと)。 '''SHELLOPTS''' に表示されるオプションは、 set -o で有効であると報告されたものである。 bashの起動時にこの変数が環境にある場合、起動ファイルを読み込む前にリストの各シェルオプションが有効になる。 この変数は読み取り専用である。 |
| 32767. Assigning a value to RANDOM initializes (seeds) the sequence of random numbers.
| | ;SHLVL |
| If RANDOM is unset, it loses its special properties, even if it is subsequently reset.
| | :bashのインスタンスが起動するたびに1ずつ増加する。 |
| READLINE_LINE
| | ;SRANDOM |
| READLINE_MARK
| | :この変数は、参照されるたびに32ビットの擬似乱数に展開される。<u>/dev/urandom</u>または<u>arc4random</u>をサポートするシステムでは、乱数生成器は線形ではないため、返される各数値はその前の数値と何の関係も持たない。 乱数生成器はシードできないので、この変数への代入は何の効果もない。 '''SRANDOM'''が設定されていない場合、その後リセットされても、その特別な特性は失われる。 |
| The position of the mark (saved insertion point) in the readline line buffer, for use with
| | ;UID |
| "bind -x" (see SHELL BUILTIN COMMANDS below). The characters between the insertion point
| | :シェル起動時に初期化される現在のユーザーのユーザーIDに展開される。 この変数は読み取り専用である。 |
| and the mark are often called the region.
| |
| READLINE_POINT
| |
| The position of the insertion point in the readline line buffer, for use with "bind -x"
| |
| (see SHELL BUILTIN COMMANDS below).
| |
| REPLY Set to the line of input read by the read builtin command when no arguments are supplied.
| |
| SECONDS
| |
| Each time this parameter is referenced, the number of seconds since shell invocation is
| |
| returned. If a value is assigned to SECONDS, the value returned upon subsequent refer‐
| |
| ences is the number of seconds since the assignment plus the value assigned. The number
| |
| of seconds at shell invocation and the current time is always determined by querying the
| |
| system clock. If SECONDS is unset, it loses its special properties, even if it is subse‐
| |
| quently reset.
| |
| SHELLOPTS
| |
| A colon-separated list of enabled shell options. Each word in the list is a valid argu‐
| |
| ment for the -o option to the set builtin command (see SHELL BUILTIN COMMANDS below). The
| |
| options appearing in SHELLOPTS are those reported as on by set -o. If this variable is in
| |
| the environment when bash starts up, each shell option in the list will be enabled before
| |
| reading any startup files. This variable is read-only.
| |
| SHLVL Incremented by one each time an instance of bash is started.
| |
| SRANDOM
| |
| This variable expands to a 32-bit pseudo-random number each time it is referenced. The
| |
| random number generator is not linear on systems that support /dev/urandom or arc4random,
| |
| so each returned number has no relationship to the numbers preceding it. The random num‐
| |
| ber generator cannot be seeded, so assignments to this variable have no effect. If SRAN‐
| |
| DOM is unset, it loses its special properties, even if it is subsequently reset.
| |
| UID Expands to the user ID of the current user, initialized at shell startup. This variable
| |
| is readonly.
| |
|
| |
|
| The following variables are used by the shell. In some cases, bash assigns a default value to a
| | 以下の変数はシェルで使用される。 bashは変数にデフォルト値を割り当てる場合がある。 |
| variable; these cases are noted below.
| |
|
| |
|
| BASH_COMPAT
| | ;BASH_COMPAT |
| The value is used to set the shell's compatibility level. See SHELL COMPATIBILITY MODE
| | :この値は、シェルの互換性レベルを設定するために使用される。 様々な互換性レベルとその効果については、後述の [[#SHELL COMPATIBILITY MODE|SHELL COMPATIBILITY MODE ]]を参照のこと。 値は、希望する互換性レベルに対応する10進数(例えば4.2)または整数(例えば42)である。 '''BASH_COMPAT'''が未設定または空文字列に設定されている場合、互換性レベルは現在のバージョンのデフォルトに設定される。 '''BASH_COMPAT'''に有効な互換性レベル以外の値が設定された場合、シェルはエラーメッセージを表示し、互換性レベルを現在のバージョンのデフォルトに設定する。 有効な値は、'''BSHELLCOMPATIBILITYMODE'''で後述する互換性レベルに対応する。 例えば、4.2と42はcompat42 shoptオプションに対応する有効な値であり、互換性レベルを42に設定する。 現在のバージョンも有効な値である。 |
| below for a description of the various compatibility levels and their effects. The value
| | ;BASH_ENV |
| may be a decimal number (e.g., 4.2) or an integer (e.g., 42) corresponding to the desired
| | :bashがシェルスクリプトを実行しているときにこのパラメータが設定されると、その値は<u>~/.bashrc</u>のようにシェルを初期化するコマンドを含むファイル名として解釈される。 '''BASH_ENV'''の値は、ファイル名として解釈される前に、パラメータ展開、コマンド置換、算術展開が行われる。 '''PATH'''は結果のファイル名の検索には使われない。 |
| compatibility level. If BASH_COMPAT is unset or set to the empty string, the compatibil‐
| | ;BASH_XTRACEFD |
| ity level is set to the default for the current version. If BASH_COMPAT is set to a value
| | :有効なファイル記述子に対応する整数に設定された場合、 bash は set -x が有効なときに生成されたトレース出力をそのファイル記述子に書き込む。 '''BASH_XTRACEFD'''の設定が解除されるか、新しい値が割り当てられると、ファイル記述子は閉じられる。 '''BASH_XTRACEFD''' の設定を解除するか、空文字列を代入すると、トレース出力は標準エラーに送られる。'''BASH_XTRACEFD'''を2(標準エラーファイルディスクリプター)に設定し、それを解除すると標準エラーは閉じられることに注意すること。 |
| that is not one of the valid compatibility levels, the shell prints an error message and
| | ;CDPATH |
| sets the compatibility level to the default for the current version. The valid values
| | :cdコマンドの検索パス。 コロンで区切られたディレクトリのリストで、シェルがcdコマンドで指定されたディレクトリを検索する。 サンプル値は <u>".:~:/usr"</u> である。 |
| correspond to the compatibility levels described below under BSHELLCOMPATIBILITYMODE. For
| | ;CHILD_MAX |
| example, 4.2 and 42 are valid values that correspond to the compat42 shopt option and set
| | :シェルが記憶しておく、終了した子プロセスのステータス値の数を設定する。 Bashはこの値をPOSIXで定められた最小値以下にすることを許さず、最大値(現在は8192)を超えてはならない。 最小値はシステムに依存する。 |
| the compatibility level to 42. The current version is also a valid value.
| | ;COLUMNS |
| BASH_ENV
| | :選択リストを印刷するときに端末の幅を決定するために select 複合コマンドで使用される。 checkwinsize オプションが有効になっているか、対話型シェルで '''SIGWINCH''' を受け取ったときに自動的に設定される。 |
| If this parameter is set when bash is executing a shell script, its value is interpreted
| | ;COMPREPLY |
| as a filename containing commands to initialize the shell, as in ~/.bashrc. The value of
| | :プログラム可能な補完機能 (下記の[[#Programmable Completion|Programmable Completion ]]を参照) によって呼び出されたシェル関数が生成する可能性のある補完を bash が読み込む配列変数。 配列の各要素には completion. |
| BASH_ENV is subjected to parameter expansion, command substitution, and arithmetic expan‐
| | ;EMACS |
| sion before being interpreted as a filename. PATH is not used to search for the resultant
| | :シェルが "t"という値で開始したときに、bashがこの変数を環境内で見つけた場合、シェルはEmacsシェル・バッファで実行されているとみなし、行の編集を無効にする。 |
| filename.
| | ;ENV |
| BASH_XTRACEFD
| | :posix モードで対話型シェルが起動されると、'''BASH_ENV'''(上記の [[#INVOCATION|INVOCATION ]]を参照)と同様に展開され実行される。 |
| If set to an integer corresponding to a valid file descriptor, bash will write the trace
| | ;EXECIGNORE |
| output generated when set -x is enabled to that file descriptor. The file descriptor is
| | :PATHを使ったコマンド検索で無視されるファイル名のリストを定義する、コロンで区切られたシェルパターンのリスト([[#Pattern Matching|Pattern Matching ]]を参照)。 これらのパターンのいずれかにフルパス名が一致するファイルは、'''PATH'''検索による補完とコマンド実行の目的上、実行可能ファイルとはみなされない。 これは、<nowiki>[]、test、[[</nowiki> コマンドの動作には影響しない。 コマンドハッシュテーブルのフルパス名は、'''EXECIGNORE'''の対象ではない。 実行可能ビットが設定されているが実行可能ファイルではない共有ライブラリファイルを無視するには、この変数を使用する。 パターン・マッチは extglob シェル・オプションの設定に従う。 |
| closed when BASH_XTRACEFD is unset or assigned a new value. Unsetting BASH_XTRACEFD or
| | ;FCEDIT |
| assigning it the empty string causes the trace output to be sent to the standard error.
| | :fc組み込みコマンドのデフォルトエディタ。 |
| Note that setting BASH_XTRACEFD to 2 (the standard error file descriptor) and then unset‐
| | ;FIGNORE |
| ting it will result in the standard error being closed.
| | :ファイル名の補完を行うときに無視する接尾辞のコロン区切りのリスト (下記の READLINE を参照)。 接尾辞が'''FIGNORE'''のエントリーにマッチするファイル名は、マッチする ファイル名のリストから除外される。 サンプル値は<nowiki>".o:~"</nowiki>である(この変数に値を代入するときは引用符で囲む必要がある。) |
| CDPATH The search path for the cd command. This is a colon-separated list of directories in
| | ;FUNCNEST |
| which the shell looks for destination directories specified by the cd command. A sample
| | :0より大きい数値に設定された場合、関数の最大入れ子レベルを定義する。 このネスティング・レベルを超える関数の呼び出しは、現在のコマンドを中断させる。 |
| value is ".:~:/usr".
| | ;GLOBIGNORE |
| CHILD_MAX
| | :パス名展開で無視するファイル名の集合を定義するパターンのコロン区切りのリスト。 パス名展開パターンにマッチしたファイル名が、'''GLOBIGNORE''' のパターンの1つにもマッチした場合、そのファイル名はマッチリストから取り除かれる。 |
| Set the number of exited child status values for the shell to remember. Bash will not al‐
| | ;HISTCONTROL |
| low this value to be decreased below a POSIX-mandated minimum, and there is a maximum
| | :コロンで区切られた値のリストで、コマンドの履歴リストへの保存方法を制御する。値のリストに ignorespace が含まれていると、スペース文字で始まる行は履歴リストに保存されない。 ignoreupsを指定すると、直前の履歴エントリと一致する行は保存されない。 ignorebothはignorespaceとignoreupsの省略形である。 erasedupsを指定すると、現在の行と一致する前の行はすべて、その行が保存される前に履歴リストから削除される。 上記のリストにない値は無視される。 '''HISTCONTROL'''が設定されていないか、有効な値が含まれていない場合、シェル・パーサが読み込んだすべての行が、'''HISTIGNORE'''の値に従って、履歴リストに保存される。 複数行の複合コマンドの2行目以降はテストされず、'''HISTCONTROL'''の値に関係なく履歴に追加される。 |
| value (currently 8192) that this may not exceed. The minimum value is system-dependent.
| | ;HISTFILE |
| COLUMNS
| | :コマンド履歴を保存するファイル名(後述の[[#HISTORY|HISTORY ]]を参照)。 デフォルト値は <u>~/.bash_history</u> である。 未設定の場合、シェルの終了時にコマンド履歴は保存されない。 |
| Used by the select compound command to determine the terminal width when printing selec‐
| | ;HISTFILESIZE |
| tion lists. Automatically set if the checkwinsize option is enabled or in an interactive
| | :履歴ファイルに含まれる最大行数。 この変数に値が代入されると、ヒストリファイルは必要に応じて、最も古いエントリを削除することによって、その行数以下に切り詰められる。 また、シェル終了時にヒストリファイルを書き込んだ後、このサイズに切り詰められる。 値が0の場合、履歴ファイルのサイズは0に切り詰められる。 数値以外の値や0未満の数値は切り捨てられない。 シェルは起動ファイルを読み込んだ後、デフォルト値を '''HISTSIZE''' の値に設定する。 |
| shell upon receipt of a SIGWINCH.
| | ;HISTIGNORE |
| COMPREPLY
| | :コロンで区切られたパターンのリストで、履歴リストに保存するコマンド行を決定するために使われる。 各パターンは行頭にアンカーされ、完全な行にマッチしなければならない (暗黙の `*' は付加されない)。 各パターンは'''HISTCONTROL'''で指定されたチェックが適用された後、その行に対してテストされる。 通常のシェルパターンにマッチする文字に加えて、`&'は前のヒストリ行にマッチする。 バックスラッシュはマッチを試みる前に取り除かれる。 複数行の複合コマンドの2行目以降はテストされず、 '''HISTIGNORE'''の値に関係なくヒストリに追加される。 パターン・マッチは extglob シェル・オプションの設定に従う。 |
| An array variable from which bash reads the possible completions generated by a shell
| | ;HISTSIZE |
| function invoked by the programmable completion facility (see Programmable Completion be‐
| | :コマンド履歴(下記の[[#HISTORY|HISTORY ]]を参照)に記憶させるコマンドの数。 値が0の場合、コマンドは履歴リストに保存されない。 0 未満の数値を指定すると、すべてのコマンドが履歴リストに保存される (上限はない)。 シェルは起動ファイルを読み込んだ後、デフォルト値を500に設定する。 |
| low). Each array element contains one possible completion.
| | ;HISTTIMEFORMAT |
| EMACS If bash finds this variable in the environment when the shell starts with value "t", it
| | この変数が設定され、かつ NULL でない場合、その値は '''[https://manpages.debian.org/bookworm/manpages-dev/strftime.3.en.html strftime]'''(3) の書式文字列として使用され、history 組み込み関数が表示する各履歴エントリに関連付けられたタイムスタンプを表示する。 この変数が設定されている場合、タイムスタンプは履歴ファイルに書き込まれ、シェルセッションを越えて保存される。 タイムスタンプを他のヒストリ行と区別するために、ヒストリのコメント文字を使用する。 |
| assumes that the shell is running in an Emacs shell buffer and disables line editing.
| | ;HOME |
| ENV Expanded and executed similarly to BASH_ENV (see INVOCATION above) when an interactive
| | :cd組み込みコマンドのデフォルト引数である。この変数の値は、チルダ展開を行うときにも使われる。 |
| shell is invoked in posix mode.
| | ;HOSTFILE |
| EXECIGNORE
| | :シェルがホスト名を補完する必要があるときに読み込む、<u>/etc/hosts</u>と同じ形式のファイルの名前を含む。 値が変更された後に次にホスト名の補完が試みられると、 bashは新しいファイルの内容を既存のリストに追加する。 '''HOSTFILE'''が設定されているが値がないか、読み取り可能なファイル名がない場合、bashは<u>/etc/hosts</u>を読み込んでホスト名補完の可能性のあるリストを取得しようとする。 '''HOSTFILE'''が設定されていない場合、ホスト名リストはクリアされる。 |
| A colon-separated list of shell patterns (see Pattern Matching) defining the list of file‐
| | ;IFS |
| names to be ignored by command search using PATH. Files whose full pathnames match one of
| | :内部フィールド区切り文字で、展開後の単語分割や、read組み込みコマンドで行を単語に分割する際に使われる。 デフォルト値は <nowiki>``<space><tab><new-line>''</nowiki> である。 |
| these patterns are not considered executable files for the purposes of completion and com‐
| | ;IGNOREEOF |
| mand execution via PATH lookup. This does not affect the behavior of the [, test, and [[
| | :唯一の入力としてEOF文字を受け取ったときの対話型シェルの動作を制御する。 設定されている場合、値は、bashが終了する前に入力行の最初の文字として入力されなければならない連続したEOF文字の数である。 この変数が存在するが数値がない場合、または値がない場合、デフォルト値は10である。 存在しない場合、EOFはシェルへの入力の終了を意味する。 |
| commands. Full pathnames in the command hash table are not subject to EXECIGNORE. Use
| | ;INPUTRC |
| this variable to ignore shared library files that have the executable bit set, but are not
| | :readline起動ファイルのファイル名。デフォルトの<u>~/.inputrc</u>を上書きする(後述の[[#READLINE|READLINE ]]を参照)。 |
| executable files. The pattern matching honors the setting of the extglob shell option.
| | ;INSIDE_EMACS |
| FCEDIT The default editor for the fc builtin command.
| | :シェルの起動時にこの変数が環境に現れると、bashはEmacsシェル・バッファ内で動作しているとみなし、'''TERM'''の値によっては行の編集を無効にすることができる。 |
| FIGNORE
| | ;LANG |
| A colon-separated list of suffixes to ignore when performing filename completion (see
| | :'''LC_'''で始まる変数で特に選択されていないカテゴリーについて、ロケール・カテゴリーを決定するために使用される。 |
| READLINE below). A filename whose suffix matches one of the entries in FIGNORE is ex‐
| | ;LC_ALL |
| cluded from the list of matched filenames. A sample value is ".o:~" (Quoting is needed
| | :この変数は、'''LANG'''およびロケールカテゴリーを指定する他の'''LC_'''変数の値を上書きする。 |
| when assigning a value to this variable, which contains tildes).
| | ;LC_COLLATE |
| FUNCNEST
| | :この変数は、パス名展開の結果をソートするときに使用される照合順序を決定し、パス名展開とパターンマッチにおける範囲式、等価クラス、照合順序の動作を決定する。 |
| If set to a numeric value greater than 0, defines a maximum function nesting level. Func‐
| | ;LC_CTYPE |
| tion invocations that exceed this nesting level will cause the current command to abort.
| | :この変数は、パス名展開とパターンマッチにおける文字の解釈と文字クラスの動作を決定する。 |
| GLOBIGNORE
| | ;LC_MESSAGES |
| A colon-separated list of patterns defining the set of file names to be ignored by path‐
| | :この変数は、$で始まる二重引用符で囲まれた文字列の翻訳に使われるロケールを決定する。 |
| name expansion. If a file name matched by a pathname expansion pattern also matches one
| | ;LC_NUMERIC |
| of the patterns in GLOBIGNORE, it is removed from the list of matches.
| | :この変数は、数値の書式設定に使われるロケールカテゴリーを決定する。 |
| HISTCONTROL
| | ;LC_TIME |
| A colon-separated list of values controlling how commands are saved on the history list.
| | :この変数は、データと時刻のフォーマットに使用されるロケールカテゴリーを決定する。 |
| If the list of values includes ignorespace, lines which begin with a space character are
| | ;LINES |
| not saved in the history list. A value of ignoredups causes lines matching the previous
| | :select 複合コマンドで使用され、選択リストを印刷する際の列の長さを決定する。 checkwinsize オプションが有効になっているか、対話型シェルで '''SIGWINCH''' を受け取ったときに自動的に設定される。 |
| history entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ig‐
| | ;MAIL |
| noredups. A value of erasedups causes all previous lines matching the current line to be
| | :このパラメータにファイル名またはディレクトリ名が設定され、'''MAILPATH'''変数が設定されていない場合、bashは指定されたファイルまたはMaildir形式のディレクトリにメールが到着したことをユーザーに通知する。 |
| removed from the history list before that line is saved. Any value not in the above list
| | ;MAILCHECK |
| is ignored. If HISTCONTROL is unset, or does not include a valid value, all lines read by
| | :bashがメールをチェックする頻度(秒)を指定する。 デフォルトは60秒である。 メールをチェックする時間になると、シェルはプライマリ・プロンプトを表示する前にチェックする。 この変数が設定されていないか、0以上の値でない場合、シェルはメールチェックを無効にする。 |
| the shell parser are saved on the history list, subject to the value of HISTIGNORE. The
| | ;MAILPATH |
| second and subsequent lines of a multi-line compound command are not tested, and are added
| | :コロンで区切られた、メールをチェックするファイル名のリスト。 特定のファイルにメールが到着したときに表示されるメッセージは、 ファイル名とメッセージを `?' で区切って指定することができる。 メッセージのテキストで使われた場合、$_は現在のメールファイル名に展開される。 例: |
| to the history regardless of the value of HISTCONTROL.
| | ::<nowiki>MAILPATH='/var/mail/bfox? "You have mail":~/shell-mail?"$_ has mail!"'</nowiki> |
| HISTFILE
| | :::Bash はこの変数にデフォルト値を与えるように設定することができる(デフォルトでは値はない)が、使用するユーザーメールファイルの場所はシステムに依存する(例えば、<u>/var/mail/$USER</u>)。 |
| The name of the file in which command history is saved (see HISTORY below). The default
| | ;OPTERR |
| value is ~/.bash_history. If unset, the command history is not saved when a shell exits.
| | :値1に設定すると、bashはgetopts組み込みコマンドで生成されたエラー・メッセージを表示する(後述の[[#SHELL BUILTIN COMMANDS|SHELL BUILTIN COMMANDS ]]を参照)。 OPTERRは、シェルが起動されるかシェル・スクリプトが実行されるたびに1に初期化される。 |
| HISTFILESIZE
| | ;PATH |
| The maximum number of lines contained in the history file. When this variable is assigned
| | :コマンドの検索パス。 コロンで区切られた、シェルがコマンドを探すディレクトリのリストである(後述の[[#COMMAND EXECUTION|COMMAND EXECUTION ]]を参照)。 '''PATH'''の値に長さゼロ(NULL)のディレクトリ名があると、カレントディレクトリを示す。 NULLディレクトリ名は、隣接する2つのコロン、または先頭または末尾のコロンとして表示される。 デフォルトのパスはシステムに依存し、bashをインストールした管理者が設定する。 一般的な値は <u>''/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''</u> である。 |
| a value, the history file is truncated, if necessary, to contain no more than that number
| | ;POSIXLY_CORRECT |
| of lines by removing the oldest entries. The history file is also truncated to this size
| | :bashの起動時にこの変数が環境に設定されていると、シェルは起動ファイルを読み込む前にposixモードに入る。 シェルの実行中にこの変数が設定されると、コマンド set -o posix が実行されたかのように、bash は posix モードを有効にする。 シェルが posix モードに入ると、この変数が設定されていなければ設定される。 |
| after writing it when a shell exits. If the value is 0, the history file is truncated to
| | ;PROMPT_COMMAND |
| zero size. Non-numeric values and numeric values less than zero inhibit truncation. The
| | :この変数がセットされ、配列である場合、各プライマリプロンプトを発行する前に、 セットされた各要素の値がコマンドとして実行される。 この変数がセットされているが配列変数でない場合、代わりにその値がコマンドとして実行される。 |
| shell sets the default value to the value of HISTSIZE after reading any startup files.
| | ;PROMPT_DIRTRIM |
| HISTIGNORE
| | :0より大きい数値が設定された場合、この値は⦅w⦆と⦅W⦆のプロンプト文字列エスケープを展開するときに保持する末尾のディレク トリ構成要素の数として使用される(下記の[[#PROMPTING|PROMPTING ]]を参照)。 削除された文字は省略記号に置き換えられる。 |
| A colon-separated list of patterns used to decide which command lines should be saved on
| | ;PS0 |
| the history list. Each pattern is anchored at the beginning of the line and must match
| | :このパラメーターの値は展開され(下記の[[#PROMPTING|PROMPTING ]]を参照)、コマンドを読み込んだ後、コマンドが実行される前に対話型シェルによって表示される。 |
| the complete line (no implicit `*' is appended). Each pattern is tested against the line
| | ;PS1 |
| after the checks specified by HISTCONTROL are applied. In addition to the normal shell
| | :このパラメータの値は展開され(下記の[[#PROMPTING|PROMPTING ]]を参照)、プライマリプロンプト文字列として使用される。 デフォルト値は <nowiki>''s-vv$''</nowiki> である。 |
| pattern matching characters, `&' matches the previous history line. `&' may be escaped
| | ;PS2 |
| using a backslash; the backslash is removed before attempting a match. The second and
| | :このパラメータの値はPS1と同様に展開され、セカンダリプロンプト文字列と して使用される。 デフォルトは <nowiki>''> ''</nowiki> である。 |
| subsequent lines of a multi-line compound command are not tested, and are added to the
| | ;PS3 |
| history regardless of the value of HISTIGNORE. The pattern matching honors the setting of
| | :このパラメータの値は、selectコマンドのプロンプトとして使われる(上記の[[#SHELL GRAMMAR|SHELL GRAMMAR ]]を参照)。 |
| the extglob shell option.
| | ;PS4 |
| HISTSIZE
| | :このパラメータの値は、PS1と同様に展開され、実行トレース中にbashが表示する各コマンドの前に表示される。 PS4の展開された値の最初の文字は、複数のレベルのインダイレクトを示すために、必要に応じて複数回繰り返される。 デフォルトは ''+'' である。 |
| The number of commands to remember in the command history (see HISTORY below). If the
| | ;SHELL |
| value is 0, commands are not saved in the history list. Numeric values less than zero re‐
| | :この変数はシェルのフルパス名に展開される。 シェルの起動時に設定されていない場合、bashは現在のユーザーのログインシェルのフルパス名をこの変数に代入する。 |
| sult in every command being saved on the history list (there is no limit). The shell sets
| | ;TIMEFORMAT |
| the default value to 500 after reading any startup files.
| | :このパラメータの値は、時間予約語を先頭に持つパイプラインのタイミン グ情報をどのように表示するかを指定するフォーマット文字列として使用される。 文字は、時間値や他の情報に展開されるエスケープシーケンスを導入する。中括弧は省略可能な部分を示す。 |
| HISTTIMEFORMAT
| | ;;<nowiki>%%</nowiki> |
| If this variable is set and not null, its value is used as a format string for strftime(3)
| | :::文字通りの%。 |
| to print the time stamp associated with each history entry displayed by the history
| | ;;<nowiki>%[p][l]R</nowiki> |
| builtin. If this variable is set, time stamps are written to the history file so they may
| | :::経過時間を秒単位で示す。 |
| be preserved across shell sessions. This uses the history comment character to distin‐
| | ;;<nowiki>%[p][l]U</nowiki> |
| guish timestamps from other history lines.
| | :::ユーザーモードで使用されたCPU秒数。 |
| HOME The home directory of the current user; the default argument for the cd builtin command.
| | ;;<nowiki>%[p][l]S</nowiki> |
| The value of this variable is also used when performing tilde expansion.
| | :::システムモードで使用されたCPU秒数。 |
| HOSTFILE
| | ;;<nowiki>%P</nowiki> |
| Contains the name of a file in the same format as /etc/hosts that should be read when the
| | :::CPU パーセント。(%U + %S) / %R として計算される。 |
| shell needs to complete a hostname. The list of possible hostname completions may be
| |
| changed while the shell is running; the next time hostname completion is attempted after
| |
| the value is changed, bash adds the contents of the new file to the existing list. If
| |
| HOSTFILE is set, but has no value, or does not name a readable file, bash attempts to read
| |
| /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset,
| |
| the hostname list is cleared.
| |
| IFS The Internal Field Separator that is used for word splitting after expansion and to split
| |
| lines into words with the read builtin command. The default value is ``<space><tab><new‐
| |
| line>''.
| |
| IGNOREEOF
| |
| Controls the action of an interactive shell on receipt of an EOF character as the sole in‐
| |
| put. If set, the value is the number of consecutive EOF characters which must be typed as
| |
| the first characters on an input line before bash exits. If the variable exists but does
| |
| not have a numeric value, or has no value, the default value is 10. If it does not exist,
| |
| EOF signifies the end of input to the shell.
| |
| INPUTRC
| |
| The filename for the readline startup file, overriding the default of ~/.inputrc (see
| |
| READLINE below).
| |
| INSIDE_EMACS
| |
| If this variable appears in the environment when the shell starts, bash assumes that it is
| |
| running inside an Emacs shell buffer and may disable line editing, depending on the value
| |
| of TERM.
| |
| LANG Used to determine the locale category for any category not specifically selected with a
| |
| variable starting with LC_.
| |
| LC_ALL This variable overrides the value of LANG and any other LC_ variable specifying a locale
| |
| category.
| |
| LC_COLLATE
| |
| This variable determines the collation order used when sorting the results of pathname ex‐
| |
| pansion, and determines the behavior of range expressions, equivalence classes, and col‐
| |
| lating sequences within pathname expansion and pattern matching.
| |
| LC_CTYPE
| |
| This variable determines the interpretation of characters and the behavior of character
| |
| classes within pathname expansion and pattern matching.
| |
| LC_MESSAGES
| |
| This variable determines the locale used to translate double-quoted strings preceded by a
| |
| $.
| |
| LC_NUMERIC
| |
| This variable determines the locale category used for number formatting.
| |
| LC_TIME
| |
| This variable determines the locale category used for data and time formatting.
| |
| LINES Used by the select compound command to determine the column length for printing selection
| |
| lists. Automatically set if the checkwinsize option is enabled or in an interactive shell
| |
| upon receipt of a SIGWINCH.
| |
| MAIL If this parameter is set to a file or directory name and the MAILPATH variable is not set,
| |
| bash informs the user of the arrival of mail in the specified file or Maildir-format di‐
| |
| rectory.
| |
| MAILCHECK
| |
| Specifies how often (in seconds) bash checks for mail. The default is 60 seconds. When
| |
| it is time to check for mail, the shell does so before displaying the primary prompt. If
| |
| this variable is unset, or set to a value that is not a number greater than or equal to
| |
| zero, the shell disables mail checking.
| |
| MAILPATH
| |
| A colon-separated list of filenames to be checked for mail. The message to be printed
| |
| when mail arrives in a particular file may be specified by separating the filename from
| |
| the message with a `?'. When used in the text of the message, $_ expands to the name of
| |
| the current mailfile. Example:
| |
| MAILPATH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"'
| |
| Bash can be configured to supply a default value for this variable (there is no value by
| |
| default), but the location of the user mail files that it uses is system dependent (e.g.,
| |
| /var/mail/$USER).
| |
| OPTERR If set to the value 1, bash displays error messages generated by the getopts builtin com‐
| |
| mand (see SHELL BUILTIN COMMANDS below). OPTERR is initialized to 1 each time the shell
| |
| is invoked or a shell script is executed.
| |
| PATH The search path for commands. It is a colon-separated list of directories in which the
| |
| shell looks for commands (see COMMAND EXECUTION below). A zero-length (null) directory
| |
| name in the value of PATH indicates the current directory. A null directory name may ap‐
| |
| pear as two adjacent colons, or as an initial or trailing colon. The default path is sys‐
| |
| tem-dependent, and is set by the administrator who installs bash. A common value is
| |
| ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.
| |
| POSIXLY_CORRECT
| |
| If this variable is in the environment when bash starts, the shell enters posix mode be‐
| |
| fore reading the startup files, as if the --posix invocation option had been supplied. If
| |
| it is set while the shell is running, bash enables posix mode, as if the command set -o
| |
| posix had been executed. When the shell enters posix mode, it sets this variable if it
| |
| was not already set.
| |
| PROMPT_COMMAND
| |
| If this variable is set, and is an array, the value of each set element is executed as a
| |
| command prior to issuing each primary prompt. If this is set but not an array variable,
| |
| its value is used as a command to execute instead.
| |
| PROMPT_DIRTRIM
| |
| If set to a number greater than zero, the value is used as the number of trailing direc‐
| |
| tory components to retain when expanding the \w and \W prompt string escapes (see PROMPT‐
| |
| ING below). Characters removed are replaced with an ellipsis.
| |
| PS0 The value of this parameter is expanded (see PROMPTING below) and displayed by interactive
| |
| shells after reading a command and before the command is executed.
| |
| PS1 The value of this parameter is expanded (see PROMPTING below) and used as the primary
| |
| prompt string. The default value is ``\s-\v\$ ''.
| |
| PS2 The value of this parameter is expanded as with PS1 and used as the secondary prompt
| |
| string. The default is ``> ''.
| |
| PS3 The value of this parameter is used as the prompt for the select command (see SHELL GRAM‐
| |
| MAR above).
| |
| PS4 The value of this parameter is expanded as with PS1 and the value is printed before each
| |
| command bash displays during an execution trace. The first character of the expanded
| |
| value of PS4 is replicated multiple times, as necessary, to indicate multiple levels of
| |
| indirection. The default is ``+ ''.
| |
| SHELL This variable expands to the full pathname to the shell. If it is not set when the shell
| |
| starts, bash assigns to it the full pathname of the current user's login shell.
| |
| TIMEFORMAT
| |
| The value of this parameter is used as a format string specifying how the timing informa‐
| |
| tion for pipelines prefixed with the time reserved word should be displayed. The % char‐
| |
| acter introduces an escape sequence that is expanded to a time value or other information.
| |
| The escape sequences and their meanings are as follows; the braces denote optional por‐
| |
| tions.
| |
| %% A literal %.
| |
| %[p][l]R The elapsed time in seconds.
| |
| %[p][l]U The number of CPU seconds spent in user mode.
| |
| %[p][l]S The number of CPU seconds spent in system mode.
| |
| %P The CPU percentage, computed as (%U + %S) / %R.
| |
|
| |
|
| The optional p is a digit specifying the precision, the number of fractional digits after
| | :オプションのpは精度を指定する桁で、小数点以下の端数の桁数を指定する。 0を指定すると小数点以下の端数は出力されない。 小数点以下の桁数は最大3桁まで指定できる。pの値が3より大きい場合は3に変更される。pが指定されない場合は3が使用される。 |
| a decimal point. A value of 0 causes no decimal point or fraction to be output. At most
| |
| three places after the decimal point may be specified; values of p greater than 3 are
| |
| changed to 3. If p is not specified, the value 3 is used.
| |
|
| |
|
| The optional l specifies a longer format, including minutes, of the form MMmSS.FFs. The
| | :オプションのlは、MMmSS.FFsの形式で、分を含む長い書式を指定する。 pの値は、分数を含めるかどうかを決定する。 |
| value of p determines whether or not the fraction is included.
| |
|
| |
|
| If this variable is not set, bash acts as if it had the value
| | :この変数が設定されていない場合、bashは<nowiki>$' \nrealt%3lR\nusert%3lU\nsysyt%3lS'</nowiki> という値を持つものとして動作する。 値がNULLの場合、タイミング情報は表示されない。 フォーマット文字列が表示されると、末尾に改行が追加される。 |
| $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'. If the value is null, no timing information is
| | ;TMOUT |
| displayed. A trailing newline is added when the format string is displayed.
| | :0 より大きい値に設定された場合、'''TMOUT''' は read 組み込み関数のデフォルトのタイムアウトとして扱われる。 ターミナルからの入力の場合、TMOUT 秒後に入力がなければ select コマンドは終了する。 対話型シェルでは、この値はプライマリプロンプトを発行してから1行の入力を待つ秒数として解釈される。 Bashは、完全な入力行が到着しない場合、その秒数待った後に終了する。 |
| TMOUT If set to a value greater than zero, TMOUT is treated as the default timeout for the read
| | ;TMPDIR |
| builtin. The select command terminates if input does not arrive after TMOUT seconds when
| | :設定された場合、bashはこの値をシェルが使用する一時ファイルを作成するディレクトリの名前として使用する。 |
| input is coming from a terminal. In an interactive shell, the value is interpreted as the
| | |
| number of seconds to wait for a line of input after issuing the primary prompt. Bash ter‐
| | ;auto_resume |
| minates after waiting for that number of seconds if a complete line of input does not ar‐
| | :この変数は、シェルがどのようにユーザーとジョブ制御をやりとりするかを制御する。 この変数が設定されている場合、リダイレクトを伴わない 単語の単純なコマンドは、停止している既存のジョブの再開候補として扱われる。 曖昧さは許されない。入力された文字列で始まるジョブが複数ある場合、最も最近アクセスされたジョブが選択される。 この文脈では、停止したジョブの名前は、そのジョブを開始するために使用されたコマンドラインである。 値がexactに設定されている場合、与えられた文字列は、停止したジョブの名前と正確に一致しなければならない。substringに設定されている場合、与えられた文字列は、停止したジョブの名前の部分文字列と一致する必要がある。 substringに設定された場合、提供される文字列は、停止したジョブの名前の部分文字列に一致する必要がある。部分文字列値は、%? 他の値に設定された場合、指定された文字列は停止したジョブの名前の接頭辞でなければならない。 |
| rive.
| | |
| TMPDIR If set, bash uses its value as the name of a directory in which bash creates temporary
| | ;histchars |
| files for the shell's use.
| | :履歴の展開とトークン化を制御する2文字または3文字である(下記の「履歴の展開」を参照)。 最初の文字はヒストリ展開文字で、ヒストリ展開の開始を示す文字であり、通常は `!' である。 2番目の文字はクイック置換文字で、前に入力したコマンドを再実行するための省略記 号として使われ、コマンド中の文字列を別の文字列に置き換える。 デフォルトは`^'である。オプションの3番目の文字は、単語の最初の文字として見つかった場合に、その行の残りがコメントであることを示す文字で、通常は`#'である。 ヒストリコメント文字は、その行の残りの単語のヒストリ置換をスキップさせる。 シェルパーサが行の残りの部分をコメントとして扱うとは限らない。 |
| auto_resume
| |
| This variable controls how the shell interacts with the user and job control. If this
| |
| variable is set, single word simple commands without redirections are treated as candi‐
| |
| dates for resumption of an existing stopped job. There is no ambiguity allowed; if there
| |
| is more than one job beginning with the string typed, the job most recently accessed is
| |
| selected. The name of a stopped job, in this context, is the command line used to start
| |
| it. If set to the value exact, the string supplied must match the name of a stopped job
| |
| exactly; if set to substring, the string supplied needs to match a substring of the name
| |
| of a stopped job. The substring value provides functionality analogous to the %? job
| |
| identifier (see JOB CONTROL below). If set to any other value, the supplied string must
| |
| be a prefix of a stopped job's name; this provides functionality analogous to the %string
| |
| job identifier.
| |
| histchars
| |
| The two or three characters which control history expansion and tokenization (see HISTORY
| |
| EXPANSION below). The first character is the history expansion character, the character
| |
| which signals the start of a history expansion, normally `!'. The second character is the
| |
| quick substitution character, which is used as shorthand for re-running the previous com‐
| |
| mand entered, substituting one string for another in the command. The default is `^'.
| |
| The optional third character is the character which indicates that the remainder of the
| |
| line is a comment when found as the first character of a word, normally `#'. The history
| |
| comment character causes history substitution to be skipped for the remaining words on the
| |
| line. It does not necessarily cause the shell parser to treat the rest of the line as a
| |
| comment.
| |
|
| |
|
| === Arrays === | | === Arrays === |