/usr/bin/dash: Difference between revisions

Line 577: Line 577:


=== Builtins ===
=== Builtins ===
This section lists the builtin commands which are builtin because they need to perform some operation that can't be performed by a separate process.  In addition to these, there are several other commands that may be builtin for efficiency (e.g.  printf(1), echo(1), test(1), etc).
このセクションでは、別のプロセスでは実行できない何らかの操作を行う必要があるためにビルトインされているビルトインコマンドを列挙する。 これら以外にも、効率化のためにビルトインされるコマンドがいくつかある(例:'''[[/usr/bin/printf|printf]]''', '''[[/usr/bin/echo|echo]]''', '''[[/usr/bin/test|test]]''' など)。


:
:


;true   
;true   
:A null command that returns a 0 (true) exit value.
:終了値0(真)を返すヌルコマンドである。


;file
;file
:The commands in the specified file are read and executed by the shell.
:指定されたファイル内のコマンドをシェルが読み込んで実行する。


;alias [name[=string ...]]
;alias [name[=string ...]]
:If name=string is specified, the shell defines the alias name with value string.  If just name is specified, the value of the alias name is printed.  With no arguments, the alias builtin prints the names and values of all defined aliases (see unalias).
:name=stringが指定された場合、シェルはエイリアス名を値文字列で定義する。 name だけが指定された場合,エイリアス名の値が表示される。 引数を指定しない場合,alias builtinは,定義されたすべてのエイリアスの名前と値を表示する(unaliasを参照)。


;bg [job] ...
;bg [job] ...
:Continue the specified jobs (or the current job if no jobs are given) in the background.
:指定されたジョブ(ジョブが指定されていない場合は現在のジョブ)をバックグラウンドで継続する。


;command [-p] [-v] [-V] command [arg ...]
;command [-p] [-v] [-V] command [arg ...]
:Execute the specified command but ignore shell functions when searching for it.  (This is useful when you have a shell function with the same name as a builtin command.)
:指定されたコマンドを実行するが、そのコマンドを検索する際にシェル関数を無視する。 (これは、組み込みコマンドと同じ名前のシェル関数がある場合に便利である)


;-p
;-p
:search for command using a PATH that guarantees to find all the standard utilities.
:PATH を使ってコマンドを検索し、すべての標準ユーティリティを見つけることが保証される。


;-V
;-V
:Do not execute the command but search for the command and print the resolution of the command search.  This is the same as the type builtin.
:コマンドを実行せず、コマンドを検索し、コマンド検索の解答を表示する。 これはタイプビルトインと同じである。


;-v
;-v
:Do not execute the command but search for the command and print the absolute pathname of utilities, the name for builtins or the expansion of aliases.
コマンドを実行せず、コマンドを検索し、ユーティリティの絶対パス名、ビルトインの名前,エイリアスの展開名を表示する。


;cd -
;cd -


;cd [-LP] [directory]
;cd [-LP] [directory]
:Switch to the specified directory (default HOME).  If an entry for CDPATH appears in the environment of the cd command or the shell variable CDPATH is set and the directory name does not begin with a slash, then the directories listed in CDPATH will be searched for the specified directory.  The format of CDPATH is the same as that of PATH.  If a single dash is specified as the argument, it will be replaced by the value of OLDPWD.  The cd command will print out the name of the directory that it actually switched to if this is different from the name that the user gave.  These may be different either because the CDPATH mechanism was used or because the argument is a single dash.  The -P option causes the physical directory structure to be used, that is, all symbolic links are resolved to their respective values.  The -L option turns off the effect of any preceding -P options.
:指定されたディレクトリに切り替える(デフォルトはHOME)。 cdコマンドの環境にCDPATHの項目があるか,シェル変数CDPATHが設定されていて,ディレクトリ名がスラッシュで始まらない場合,CDPATHに記載されているディレクトリを検索して,指定したディレクトリに移動する。 CDPATHの形式は,PATHの形式と同じである。 引数に単一のダッシュが指定された場合、それはOLDPWDの値に置き換えられる。 cdコマンドは,実際に切り替えたディレクトリの名前が,ユーザが与えた名前と異なる場合,その名前を出力する。 これらは、CDPATH機構が使用されたためか、引数がダッシュ1つであったためか、異なる可能性がある。 Pオプションは、物理的なディレクトリ構造を使用するようにする。つまり、すべてのシンボリックリンクはそれぞれの値に解決される。 Lオプションは、先行する-Pオプションの効果を無効にする。


;echo [-n] args...
;echo [-n] args...
:Print the arguments on the standard output, separated by spaces.  Unless the -n option is present, a newline is output following the arguments.
:引数をスペースで区切って標準出力に出力する。 nオプションがない限り、引数の後に改行が出力される。


:If any of the following sequences of characters is encountered during output, the sequence is not output.  Instead, the specified action is performed:
:出力中に以下の文字列のいずれかに遭遇した場合、その文字列は出力されない。 出力中に以下の文字列に遭遇した場合、その文字列は出力されず、代わりに指定された動作が実行される:


::\b      A backspace character is output.
::\b      バックスペース文字が出力される。


::\c      Subsequent output is suppressed.  This is normally used at the end of the last argument to suppress the trailing newline that echo would otherwise output.
::\c      その後の出力を抑制する。 通常、最後の引数の末尾で使用し、echo が出力するはずの末尾の改行を抑止する。


::\e      Outputs an escape character (ESC).
::\e      エスケープ文字(ESC)を出力する。


::\f      Output a form feed.
::\f      フォームフィードを出力する。


::\n      Output a newline character.
::\n      改行文字を出力する。


::\r     Output a carriage return.
::\r     キャリッジリターンを出力する。


::\t      Output a (horizontal) tab character.
::\t      (横)タブ文字を出力する。


::\v     Output a vertical tab.
::\v     (縦)タブを出力する。


::\0digits
::\0digits
:::Output the character whose value is given by zero to three octal digits.  If there are zero digits, a nul character is output.
:::8進数0~3桁で与えられる値を持つ文字を出力する。 0桁の場合はnul文字が出力される。


::\\      Output a backslash.
::\\      バックスラッシュを出力する。


:All other backslash sequences elicit undefined behaviour.
:それ以外のバックスラッシュの配列は、未定義の動作を引き起こす。


;eval string ...
;eval string ...
:Concatenate all the arguments with spaces.  Then re-parse and execute the command.
:すべての引数をスペースで連結する。 その後、コマンドを再パースして実行する。


;exec [command arg ...]
;exec [command arg ...]
:Unless command is omitted, the shell process is replaced with the specified program (which must be a real program, not a shell builtin or function).  Any redirections on the exec command are marked as permanent, so that they are not undone when the exec command finishes.
:commandが省略されない限り、シェルプロセスは指定されたプログラム(これはシェルの組み込みや関数ではなく、実際のプログラムでなければならない)に置き換えられる。 execコマンドのリダイレクションは、execコマンドの終了時に元に戻らないように、永久的なものとしてマークされる。


;exit [exitstatus]
;exit [exitstatus]
:Terminate the shell process.  If exitstatus is given it is used as the exit status of the shell; otherwise the exit status of the preceding command is used.
:シェルプロセスを終了させる。 exitstatusが与えられた場合は、シェルの終了ステータスとして使用され、それ以外の場合は、直前のコマンドの終了ステータスが使用される。


;export name ...
;export name ...


;export -p
;export -p
:The specified names are exported so that they will appear in the environment of subsequent commands.  The only way to un-export a variable is to unset it.  The shell allows the value of a variable to be set at the same time it is exported by writing
:指定された名前は、後続のコマンドの環境に表示されるようにエクスポートされる。 変数のエクスポートを解除する唯一の方法は、変数の設定を解除することである。 シェルでは,次のように書くことで,変数のエクスポートと同時に変数の値を設定することができる。


::export name=value
::export name=value


:With no arguments the export command lists the names of all exported variables.  With the -p option specified the output will be formatted suitably for non-interactive use.
:引数を指定しない場合、exportコマンドはエクスポートされたすべての変数名を一覧表示する。 pオプションを指定すると、出力は非対話的な使用のために適切にフォーマットされる。


;fc [-e editor] [first [last]]
;fc [-e editor] [first [last]]
Line 661: Line 661:


;fc -s [old=new] [first]
;fc -s [old=new] [first]
:The fc builtin lists, or edits and re-executes, commands previously entered to an interactive shell.
:fcビルトインは、対話型シェルに過去に入力したコマンドを一覧表示したり、編集して再実行する。


:-e editor
:-e editor
::Use the editor named by editor to edit the commands.  The editor string is a command name, subject to search via the PATH variable.  The value in the FCEDIT variable is used as a default when -e is not specified.  If FCEDIT is null or unset, the value of the EDITOR variable is used.  If EDITOR is null or unset, ed(1) is used as the editor.
::コマンドの編集には、editorで指定されたエディタを使用する。 エディタ文字列はコマンド名であり、PATH変数による検索の対象となる。 eが指定されない場合、FCEDIT変数の値がデフォルトとして使用される。 FCEDITがNULLまたは未設定の場合は、EDITOR変数の値が使用される。 EDITORがNULLまたは未設定の場合、エディタとして'''[[/usr/bin/ed|ed]]'''が使用される。


:-l (ell)
:-l (ell)
::List the commands rather than invoking an editor on them.  The commands are written in the sequence indicated by the first and last operands, as affected by -r, with each command preceded by the command number.
::コマンドに対してエディタを起動するのではなく、コマンドをリストアップする。 コマンドは,-rの影響を受けて,最初と最後のオペランドで示される順序で書かれ,各コマンドの前にはコマンド番号が付けられる.


:-n    Suppress command numbers when listing with -l.
:-n    -lでリストアップする際に、コマンド番号を表示しないようにする。


:-r    Reverse the order of the commands listed (with -l) or edited (with neither -l nor -s).
:-r    リストアップされたコマンド(-l付き)または編集されたコマンド(-lも-sもなし)の順序を逆にする。


:-s    Re-execute the command without invoking an editor.
:-s    エディタを起動せずにコマンドを再実行する。


:first
:first


:last  Select the commands to list or edit.  The number of previous commands that can be accessed are determined by the value of the HISTSIZE variable.  The value of first or last or both are one of the following:
:last  リストアップまたは編集するコマンドを選択する。 アクセスできる前のコマンドの数は、変数HISTSIZEの値によって決定される。 firstまたはlast、あるいはその両方の値は、次のいずれかである:


::[+]number
::[+]number
:::A positive number representing a command number; command numbers can be displayed with the -l option.
:::コマンド番号を表す正の数。コマンド番号は-lオプションで表示することができる。


::-number
::-number
:::A negative decimal number representing the command that was executed number of commands previously.  For example, -1 is the immediately previous command.
:::何個か前に実行されたコマンドを表す負の10進数である。 例えば、-1 は直前のコマンドである。


:string
:string
::A string indicating the most recently entered command that begins with that string.  If the old=new operand is not also specified with -s, the string form of the first operand cannot contain an embedded equal sign.
::その文字列で始まる、最も最近入力されたコマンドを示す文字列である。 old=newオペランドが-sでも指定されない場合、最初のオペランドの文字列形式は、埋め込まれた等号を含むことはできない。


:The following environment variables affect the execution of fc:
:以下の環境変数がfcの実行に影響を与える:


:FCEDIT    Name of the editor to use.
:FCEDIT    使用するエディターの名前。


:HISTSIZE  The number of previous commands that are accessible.
:HISTSIZE  アクセス可能な過去のコマンドの数。


;fg [job]
;fg [job]
:Move the specified job or the current job to the foreground.
:指定されたジョブまたは現在のジョブをフォアグラウンドに移動させる。


;gtopts optstring var
;gtopts optstring var
:The POSIX getopts command, not to be confused with the Bell Labs -derived getopt(1).
:POSIXのgetoptsコマンドで、ベル研由来の'''[[/usr/bin/getopt|getopt]]'''と混同しないように。


:The first argument should be a series of letters, each of which may be optionally followed by a colon to indicate that the option requires an argument.  The variable specified is set to the parsed option.
:最初の引数は、一連の文字でなければならず、それぞれの文字には、オプションが引数を必要とすることを示すコロンがオプションとして続くことができる。 指定された変数は,解析されたオプションに設定される。


:The getopts command deprecates the older getopt(1) utility due to its handling of arguments containing whitespace.
:getoptsコマンドは、空白を含む引数の扱いのため、古い'''[[/usr/bin/getopt|getopt]]'''ユーティリティを非推奨とする。


:The getopts builtin may be used to obtain options and their arguments from a list of parameters.  When invoked, getopts places the value of the next option from the option string in the list in the shell variable specified by var and its index in the shell variable OPTIND.  When the shell is invoked, OPTIND is initialized to 1.  For each option that requires an argument, the getopts builtin will place it in the shell variable OPTARG.  If an option is not allowed for in the optstring, then OPTARG will be unset.
:getopts 組み込み関数を使って、パラメータのリストからオプションとその引数を取得することができる。 getoptsは,起動されると,リスト中のオプション文字列から次のオプションの値をvarで指定されるシェル変数に,そのインデックスをシェル変数OPTINDに置く。 シェルが起動されると、OPTINDは1に初期化される。 引数を必要とする各オプションについて、getopts 組み込み関数がシェル変数 OPTARG に配置する。 オプションがoptstringで許可されていない場合、OPTARGはアンセットされる。


:optstring is a string of recognized option letters (see getopt(3)).  If a letter is followed by a colon, the option is expected to have an argument which may or may not be separated from it by white space.  If an option character is not found where expected, getopts will set the variable var to a “?; getopts will then unset OPTARG and write output to standard error.  By specifying a colon as the first character of optstring all errors will be ignored.
:optstring は、認識されたオプション文字列である ('''[https://manpages.debian.org/bullseye/manpages-dev/getopt.3.en.html getopt]]'''(3) を参照)。 文字にコロンが続く場合、そのオプションは空白で区切られていてもいなくてもよい引数を持つことが期待される。 オプション文字が期待通りに見つからなかった場合、getopts は変数 var を "?" に設定する; 次に getopts OPTARG をアンセットして標準エラーに出力を書き出す。 optstringの最初の文字にコロンを指定することで、すべてのエラーを無視することができる。


:After the last option getopts will return a non-zero value and set var to “?”.
:最後のオプションの後、getoptsは0以外の値を返し、varに"?"をセットする。


:The following code fragment shows how one might process the arguments for a command that can take the options [a] and [b], and the option [c], which requires an argument.
:次のコードは、オプション<nowiki>[a]</nowiki>と<nowiki>[b]</nowiki>、および引数を必要とするオプション<nowiki>[c]</nowiki>を取ることができるコマンドの引数をどのように処理するかを示している。


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 724: Line 724:
</syntaxhighlight>
</syntaxhighlight>


:This code will accept any of the following as equivalent:
:本コードは、以下のいずれかを等価として受け付ける:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 734: Line 734:


;hash -rv command ...
;hash -rv command ...
:The shell maintains a hash table which remembers the locations of commands.  With no arguments whatsoever, the hash command prints out the contents of this table.  Entries which have not been looked at since the last cd command are marked with an asterisk; it is possible for these entries to be invalid.
:シェルは、コマンドの位置を記憶するハッシュテーブルを保持している。 引数なしで、hashコマンドはこのテーブルの内容をプリントアウトする。 最後にcdコマンドを実行してから一度も見ていない項目には、アスタリスクが付けられている。これらの項目が無効である可能性もある。


:With arguments, the hash command removes the specified commands from the hash table (unless they are functions) and then locates them.  With the -v option, hash prints the locations of the commands as it finds them.  The -r option causes the hash command to delete all the entries in the hash table except for functions.
:引数を指定すると、hashコマンドは指定されたコマンドをハッシュテーブルから削除し(それが関数でない限り)、次にそれらの位置を特定する。 -vオプションをつけると、ハッシュは見つけたコマンドの位置を表示する。 -rオプションをつけると、hashコマンドはハッシュテーブルの関数を除くすべてのエントリーを削除する。


;pwd [-LP]
;pwd [-LP]
:builtin command remembers what the current directory is rather than recomputing it each time. This makes it faster.  However, if the current directory is renamed, the builtin version of pwd will continue to print the old name for the directory.  The -P option causes the physical value of the current working directory to be shown, that is, all symbolic links are resolved to their respective values.  The -L option turns off the effect of any preceding -P options.
:内蔵コマンドは、毎回再計算するのではなく、カレントディレクトリが何であるかを記憶している。そのため、より高速に動作する。 しかし,カレントディレクトリの名前が変更された場合,pwdのビルトイン版はディレクトリの古い名前を表示しつづける. -Pオプションは、現在の作業ディレクトリの物理的な値を表示する、つまり、すべてのシンボリックリンクがそれぞれの値に解決されるようにする。 -Lオプションは,先行する-Pオプションの効果を無効にする.


;read [-p prompt] [-r] variable [...]
;read [-p prompt] [-r] variable [...]
:The prompt is printed if the -p option is specified and the standard input is a terminal.  Then a line is read from the standard input.  The trailing newline is deleted from the line and the line is split as described in the section on word splitting above, and the pieces are assigned to the variables in order.  At least one variable must be specified.  If there are more pieces than variables, the remaining pieces (along with the characters in IFS that separated them) are assigned to the last variable.  If there are more variables than pieces, the remaining varibles are assigned the null string.  The read builtin will indicate success unless EOF is encountered on input, in which case failure is returned.
:-pオプションが指定され,標準入力が端末である場合は,プロンプトが表示される。 次に,標準入力から1行が読み込まれる。 行末の改行が削除され,上記の単語分割の項で説明したように行が分割され,その断片が順番に変数に代入される。 少なくとも1つの変数が指定されなければならない。 駒が変数より多い場合は、残りの駒(駒を区切ったIFSの文字とともに)が最後の変数に代入される。 ピースより変数の方が多い場合は、残りの変数にヌル文字列が代入される。 入力で EOF に遭遇しない限り、read 組み込みは成功を示し、その場合は失敗が返される。


:By default, unless the -r option is specified, the backslash “\” acts as an escape character, causing the following character to be treated literally.  If a backslash is followed by a newline, the backslash and the newline will be deleted.
:デフォルトでは、-rオプションが指定されない限り、バックスラッシュ"˶"はエスケープ文字として機能し、次の文字を文字通りに処理する。 バックスラッシュの後に改行がある場合、バックスラッシュと改行は削除される。


;readonly name ...
;readonly name ...


;readonly -p
;readonly -p
:The specified names are marked as read only, so that they cannot be subsequently modified or unset.  The shell allows the value of a variable to be set at the same time it is marked read only by writing
:指定された名前は読み取り専用としてマークされ、その後に変更したり設定を解除したりすることはできない。 シェルは,変数の値を,それが読み取り専用にマークされると同時に設定することを,次のように書くことで可能にする。


;readonly name=value
;readonly name=value


:With no arguments the readonly command lists the names of all read only variables.  With the -p option specified the output will be formatted suitably for non-interactive use.
:引数を指定しない場合、readonlyコマンドはすべての読み取り専用変数の名前を一覧表示する。 -pオプションを指定すると、出力は非対話的な使用に適した形式になる。


;printf format [arguments ...]
;printf format [arguments ...]
:printf formats and prints its arguments, after the first, under control of the format.  The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument.
:printfは、フォーマットの制御の下、引数をフォーマットし、最初の引数の後に印刷する。 フォーマットは,3種類のオブジェクトを含む文字列である。すなわち,単に標準出力にコピーされるプレーン文字,変換されて標準出力にコピーされる文字エスケープシーケンス,およびフォーマット指定であり,その各々が次の連続する引数の印刷を引き起こす。


:The arguments after the first are treated as strings if the corresponding format is either b, c or s; otherwise it is evaluated as a C constant, with the following extensions:
:第1引数以降の引数は,対応する形式がb,c,sのいずれかであれば文字列として扱われ,そうでなければC定数として評価され,次のように拡張される:


::•  A leading plus or minus sign is allowed.
::•  先頭のプラスまたはマイナス記号は許容される。
::•  If the leading character is a single or double quote, the value is the ASCII code of the next character.
::•  先頭の文字がシングルクォートまたはダブルクォートの場合、値は次の文字のASCIIコードとなる。


:The format string is reused as often as necessary to satisfy the arguments.  Any extra format specifications are evaluated with zero or the null string.
:書式文字列は,引数を満たすのに必要な回数だけ再利用される。 余分な書式指定は,0またはNULL文字列で評価される。


:Character escape sequences are in backslash notation as defined in ANSI X3.159-1989 (“ANSI C89”).  The characters and their meanings are as follows:
:文字エスケープシーケンスは、ANSI X3.159-1989("ANSI C89")で定義されているバックスラッシュ表記である。 文字とその意味は次の通りである:


::\a      Write a <bell> character.
::\a      <bell>のキャラクターを書く。


::\b      Write a <backspace> character.
::\b      <backspace>文字を書く。


::\e      Write an <escape> (ESC) character.
::\e      <escape>(ESC)文字を書く。


::\f      Write a <form-feed> character.
::\f      <form-feed>文字を書く。


::\n      Write a <new-line> character.
::\n      <改行>文字を書く。


::\r      Write a <carriage return> character.
::\r      <carriage return>文字を書く。


::\t      Write a <tab> character.
::\t      <tab>文字を書く。


::\v      Write a <vertical tab> character.
::\v      <垂直タブ>文字を書く。


::\\      Write a backslash character.
::\\      バックスラッシュ文字を書き込む。


::\num    Write an 8-bit character whose ASCII value is the 1-, 2-, or 3-digit octal number num.
::\num    ASCII値が1桁、2桁、3桁の8進数numである8ビット文字を書く。


:Each format specification is introduced by the percent character (``%'').  The remainder of the format specification includes, in the following order:
:各フォーマット指定は,パーセント文字(``%'')によって導入される。 フォーマット指定の残りは,次の順序で,以下を含む:


:Zero or more of the following flags:
:以下のフラグのうち、0個以上を指定する:


::#      A `#' character specifying that the value should be printed in an ``alternative form''.  For b, c, d, and s formats, this option has no effect.  For the o format the precision of the number is increased to force the first character of the output string to a zero.  For the x (X) format, a non-zero result has the string 0x (0X) prepended to it.  For e, E, f, g, and G formats, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point only appears in the results of those formats if a digit follows the decimal point).  For g and G formats, trailing zeros are not removed from the result as they would otherwise be.
::#      代替形式で表示されることを指定する `#' 文字を指定する。 b,c,d,sフォーマットでは,このオプションは何の効果もない。 oフォーマットでは,数値の精度を上げて,出力文字列の最初の文字をゼロにする。 x(エックス)フォーマットでは,0以外の結果には,文字列0x(0X)が先頭に付く。 e、E、f、g、G形式では、小数点以下の桁がない場合でも、結果には常に小数点が含まれる(通常、これらの形式の結果には、小数点以下の桁がある場合にのみ小数点が表示される)。 gおよびGフォーマットでは、末尾のゼロは、他の場合と同様に結果から取り除かれない。


::-      A minus sign `-' which specifies left adjustment of the output in the indicated field;
::-      マイナス記号 `-' は、指定されたフィールドの出力を左に調整することを指定する;


::+      A `+' character specifying that there should always be a sign placed before the number when using signed formats.
::+      符号付き書式を使用する場合、数値の前に常に符号を置くことを指定する `+' 文字。


::' ’    A space specifying that a blank should be left before a positive number for a signed format.  A `+' overrides a space if both are used;
::' ’    符号付きフォーマットの場合、正の数の前に空白を残すことを指定する。 両方が使われている場合、`+'はスペースより優先される;


::0      A zero `0' character indicating that zero-padding should be used rather than blank-padding.  A `-' overrides a `0' if both are used;
::0      '0'文字は、空白パディングではなく、ゼロパディングを使用することを示す。 両方が使用される場合、`-' `0' に優先する;


:Field Width:
:Field Width:
::An optional digit string specifying a field width; if the output string has fewer characters than the field width it will be blank-padded on the left (or right, if the left-adjustment indicator has been given) to make up the field width (note that a leading zero is a flag, but an embedded zero is part of a field width);
::出力文字列の文字数がフィールド幅より少ない場合,フィールド幅を補うために左側(左調整インジケータが与えられている場合は右側)に空白パディングされる(先行ゼロはフラグであるが,埋め込まれたゼロはフィールド幅の一部であることに注意すること);


:Precision:
:Precision:
::An optional period, ‘.’, followed by an optional digit string giving a precision which specifies the number of digits to appear after the decimal point, for e and f formats, or the maximum number of bytes to be printed from a string (b and s formats); if the digit string is missing, the precision is treated as zero;
::オプションのピリオド,'.'の後に,eおよびf形式の場合は小数点以下の桁数,bおよびs形式の場合は文字列から出力される最大バイト数を指定する精度を与えるオプションの数字文字列が続く;


:Format:
:Format:
::A character which indicates the type of format to use (one of diouxXfwEgGbcs).
::使用するフォーマットの種類を示す文字(diouxXfwEgGbcs のいずれか)である。


:A field width or precision may be ‘*’ instead of a digit string.  In this case an argument supplies the field width or precision.
:フィールドの幅や精度は,数字文字列の代わりに'*'とすることもできる。 この場合,引数でフィールドの幅や精度を指定する。


:The format characters and their meanings are:
:フォーマット文字とその意味は次の通りである:


::diouXx      The argument is printed as a signed decimal (d or i), unsigned octal, unsigned decimal, or unsigned hexadecimal (X or x), respectively.
::diouXx      引数は,それぞれ符号付き10進数(dまたはi),符号なし8進数,符号なし10進数,符号なし16進数(Xまたはx)として出力される。


::f          The argument is printed in the style [-]ddd.ddd where the number of d's after the decimal point is equal to the precision specification for the argument.  If the precision is missing, 6 digits are given; if the precision is explicitly 0, no digits and no decimal point are printed.
::f          引数は,[-]ddd.dddのスタイルで表示され,小数点以下のdの数が引数の精度指定と等しくなる。 精度がない場合は6桁が与えられ,精度が明示的に0である場合は,桁と小数点は表示されない。


::eE          The argument is printed in the style [-]d.ddde±dd where there is one digit before the decimal point and the number after is equal to the precision specification for the argument; when the precision is missing, 6 digits are produced.  An upper-case E is used for an `E' format.
::eE          引数は,[-]d.ddde±ddのスタイルで印刷される。ここで,小数点以下の桁数は引数の精度指定に等しく,精度が不足する場合は6桁が生成される。 E'形式には,大文字のEが使われる。


::gG          The argument is printed in style f or in style e (E) whichever gives full precision in minimum space.
::gG          引数は,スタイルfまたはスタイルe(E)のどちらか,最小限のスペースで完全な精度を与えるほうで印刷される。


::b          Characters from the string argument are printed with backslash-escape sequences expanded. The following additional backslash-escape sequences are supported:
::b          文字列引数の文字は、バックスラッシュ・エスケープ・シーケンスを展開した状態で印刷される。以下の追加バックスラッシュ・エスケープ・シーケンスがサポートされている:


::\c      Causes dash to ignore any remaining characters in the string operand containing it, any remaining string operands, and any additional characters in the format operand.
::\c      dashを含む文字列オペランドの残りの文字、残りの文字列オペランド、およびformatオペランドの追加文字を無視するようにする。


::\0num  Write an 8-bit character whose ASCII value is the 1-, 2-, or 3-digit octal number num.
::\0num  ASCII値が1桁、2桁、3桁の8進数numである8ビット文字を書く。


::c          The first character of argument is printed.
::c          引数の1文字目を印字する。


::s          Characters from the string argument are printed until the end is reached or until the number of bytes indicated by the precision specification is reached; if the precision is omitted, all characters in the string are printed.
::s          文字列引数の文字は,末尾に達するか,精度指定で示されるバイト数に達するまで印刷される。精度が省略された場合,文字列のすべての文字が印刷される。


::%          Print a `%'; no argument is used.
::%          引数なしで `%' を表示する。


:In no case does a non-existent or small field width cause truncation of a field; padding takes place only if the specified field width exceeds the actual width.
:パディングは、指定されたフィールド幅が実際の幅を超える場合にのみ行われる。


;set [{ -options | +options | -- }] arg ...
;set [{ -options | +options | -- }] arg ...
:The set command performs three different functions.
:setコマンドは、3つの異なる機能を実行する。


:With no arguments, it lists the values of all shell variables.
:引数なしで、すべてのシェル変数の値をリストアップする。


:If options are given, it sets the specified option flags, or clears them as described in the section called Argument List Processing.  As a special case, if the option is -o or +o and no argument is supplied, the shell prints the settings of all its options.  If the option is -o, the settings are printed in a human-readable format; if the option is +o, the settings are printed in a format suitable for reinput to the shell to affect the same option settings.
:オプションが与えられた場合、引数リスト処理というセクションで説明されているように、指定されたオプションフラグを設定し、またはそれらをクリアする。 特殊なケースとして、オプションが-oまたは+oで引数が与えられない場合、シェルはそのすべてのオプションの設定を印刷する。 オプションが-oの場合,設定は人間が読める形式で印刷され,オプションが+oの場合,設定は,同じオプション設定に影響を与えるためにシェルに再入力するのに適した形式で印刷される。


:The third use of the set command is to set the values of the shell's positional parameters to the specified args.  To change the positional parameters without changing any options, use “--” as the first argument to set.  If no args are present, the set command will clear all the positional parameters (equivalent to executing “shift $#”.)
:setコマンドの3つ目の使い方は、シェルの位置パラメーターの値を指定されたargsに設定することである。 オプションを変更せずに位置パラメータを変更するには、setの第1引数として「--」を使用する。 引数がない場合、setコマンドはすべての位置パラメータをクリアする(「shift $#」を実行するのと同じことである)。


;shift [n]
;shift [n]
:Shift the positional parameters n times.  A shift sets the value of $1 to the value of $2, the value of $2 to the value of $3, and so on, decreasing the value of $# by one.  If n is greater than the number of positional parameters, shift will issue an error message, and exit with return status 2.
:位置パラメータをn回シフトさせる。 シフトは、$1の値を$2の値に、$2の値を$3の値に...と、$#の値を1つずつ減らしていくように設定する。 nが位置パラメータの数より大きい場合、shiftはエラーメッセージを発行し、リターンステータス2で終了する。


;test expression
;test expression


;[ expression ]
;[ expression ]
:The test utility evaluates the expression and, if it evaluates to true, returns a zero (true) exit status; otherwise it returns 1 (false).  If there is no expression, test also returns 1 (false).
:testユーティリティは、式を評価し、それが真と評価された場合、0(真)の終了ステータスを返し、そうでない場合、1(偽)を返す。 式がない場合、testは1(false)を返す。


:All operators and flags are separate arguments to the test utility.
:すべての演算子やフラグは、テストユーティリティの個別の引数である。


:The following primaries are used to construct expression:
:表現を構築するために、以下のプライマリーを使用する:


::-b file      True if file exists and is a block special file.
::-b file      fileが存在し、ブロック特殊ファイルである場合はtrueとなる。


::-c file      True if file exists and is a character special file.
::-c file      fileが存在し、かつ文字特殊ファイルである場合にtrueとなる。


::-d file      True if file exists and is a directory.
::-d file      ファイルが存在し、ディレクトリであればtrueとなる。


::-e file      True if file exists (regardless of type).
::-e file      ファイルが存在する場合、(タイプに関係なく)trueとなる。


::-f file      True if file exists and is a regular file.
::-f file      ファイルが存在し、通常のファイルであればtrueとなる。


::-g file      True if file exists and its set group ID flag is set.
::-g file      ファイルが存在し、そのグループIDフラグが設定されている場合はtrueとなる。


::-h file      True if file exists and is a symbolic link.
::-h file      ファイルが存在し、シンボリックリンクである場合はtrueとなる。


::-k file      True if file exists and its sticky bit is set.
::-k file      ファイルが存在し、そのスティッキービットが設定されている場合はtrueとなる。


::-n string    True if the length of string is nonzero.
::-n string    文字列の長さが0でない場合、trueとなる。


::-p file      True if file is a named pipe (FIFO).
::-p file      fileが名前付きパイプ(FIFO)であればtrueとなる。


::-r file      True if file exists and is readable.
::-r file      ファイルが存在し、読み取り可能であればtrueとなる。


::-s file      True if file exists and has a size greater than zero.
::-s file      ファイルが存在し、かつサイズが0より大きい場合、trueとなる。


::-t file_descriptor
::-t file_descriptor
:::True if the file whose file descriptor number is file_descriptor is open and is associated with a terminal.
:::ファイルディスクリプタ番号がfile_descriptorであるファイルが開いており、かつ端末と関連付けられている場合にtrueとなる。


::-u file      True if file exists and its set user ID flag is set.
::-u file      ファイルが存在し、そのユーザIDフラグが設定されている場合はtrueとなる。


::-w file      True if file exists and is writable.  True indicates only that the write flag is on.  The file is not writable on a read-only file system even if this test indicates true.
::-w file      ファイルが存在し、書き込み可能であればtrueとなる。 Trueは、書き込みフラグがオンであることだけを示す。 このテストが真であっても、読み取り専用ファイルシステム上では、ファイルは書き込み可能ではない。


::-x file      True if file exists and is executable.  True indicates only that the execute flag is on.  If file is a directory, true indicates that file can be searched.
::-x file      ファイルが存在し、実行可能であればtrueとなる。 trueは、実行フラグがオンであることのみを示す。 fileがディレクトリの場合、trueはファイルが検索可能であることを示す。


::-z string    True if the length of string is zero.
::-z string    文字列の長さがゼロの場合、trueとなる。


::-L file      True if file exists and is a symbolic link.  This operator is retained for compatibility with previous versions of this program.  Do not rely on its existence; use -h instead.
::-L file      ファイルが存在し、シンボリックリンクである場合はtrueとなる。 この演算子は、このプログラムの以前のバージョンとの互換性のために残されている。 この演算子の存在に依存せず、代わりに-hを使用する。


::-O file      True if file exists and its owner matches the effective user id of this process.
::-O file      ファイルが存在し、その所有者がこのプロセスの有効なユーザIDと一致する場合、trueとなる。


::-G file      True if file exists and its group matches the effective group id of this process.
::-G file      ファイルが存在し、そのグループがこのプロセスの有効なグループIDに一致する場合、trueとなる。


::-S file      True if file exists and is a socket.
::-S file      ファイルが存在し、かつソケットであればtrueとなる。


::file1 -nt file2
::file1 -nt file2
:::True if file1 and file2 exist and file1 is newer than file2.
:::file1とfile2が存在し、file1がfile2より新しい場合にtrueとなる。


::file1 -ot file2
::file1 -ot file2
:::True if file1 and file2 exist and file1 is older than file2.
:::file1とfile2が存在し、file1がfile2より古い場合にtrueとなる。


::file1 -ef file2
::file1 -ef file2
:::True if file1 and file2 exist and refer to the same file.
:::file1とfile2が存在し、同じファイルを参照している場合はtrueとなる。


::string        True if string is not the null string.
::string        stringがNULL文字列でない場合はtrueとなる。


::s1 = s2      True if the strings s1 and s2 are identical.
::s1 = s2      文字列s1、s2が同一であればtrueとなる。


::s1 != s2      True if the strings s1 and s2 are not identical.
::s1 != s2      文字列s1、s2が同一でない場合にtrueとなる。


::s1 < s2      True if string s1 comes before s2 based on the ASCII value of their characters.
::s1 < s2      文字列s1がs2より先に来た場合、それらの文字のASCII値に基づいてtrueとなる。


::s1 > s2      True if string s1 comes after s2 based on the ASCII value of their characters.
::s1 > s2      文字列s1がs2の後に来る場合、それらの文字のASCII値に基づいてtrueとなる。


::n1 -eq n2    True if the integers n1 and n2 are algebraically equal.
::n1 -eq n2    整数n1、n2が代数的に等しければtrueなる。


::n1 -ne n2    True if the integers n1 and n2 are not algebraically equal.
::n1 -ne n2    整数n1、n2が代数的に等しくない場合はtrueとなる。


::n1 -gt n2    True if the integer n1 is algebraically greater than the integer n2.
::n1 -gt n2    整数n1が整数n2より代数的に大きい場合にtrueとなる。


::n1 -ge n2    True if the integer n1 is algebraically greater than or equal to the integer n2.
::n1 -ge n2    整数n1が整数n2より代数的に大きいか等しい場合に真となる。


::n1 -lt n2    True if the integer n1 is algebraically less than the integer n2.
::n1 -lt n2    整数n1が整数n2より代数的に小さい場合に真となる。


::n1 -le n2    True if the integer n1 is algebraically less than or equal to the integer n2.
::n1 -le n2    整数n1が代数的に整数n2より小さいか等しい場合にtrueとなる。


:These primaries can be combined with the following operators:
:これらのプライマリーは、以下の演算子で組み合わせることができる:


::! expression  True if expression is false.
::!式がfalseの場合、trueとなる。


::expression1 -a expression2
::expression1 -a expression2
:::True if both expression1 and expression2 are true.
:::expression1 expression2 の両方が真であればtrueとなる。


::expression1 -o expression2
::expression1 -o expression2
:::True if either expression1 or expression2 are true.
:::expression1 expression2 のいずれかが真であればtrueとなる。


::(expression)  True if expression is true.
::(expression)  式がtrueであればtrueとする。


:The -a operator has higher precedence than the -o operator.
:-a演算子は-o演算子より優先順位が高い。


:times  Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0.
;times   
:シェルおよびシェルから実行されたプロセスの累積ユーザ時間およびシステム時間を表示する。戻りステータスは 0 である。


;trap [action signal ...]
;trap [action signal ...]
:Cause the shell to parse and execute action when any of the specified signals are received. The signals are specified by signal number or as the name of the signal.  If signal is 0 or EXIT, the action is executed when the shell exits.  action may be empty (''), which causes the specified signals to be ignored.  With action omitted or set to `-' the specified signals are set to their default action.  When the shell forks off a subshell, it resets trapped (but not ignored) signals to the default action.  The trap command has no effect on signals that were ignored on entry to the shell.  trap without any arguments cause it to write a list of signals and their associated action to the standard output in a format that is suitable as an input to the shell that achieves the same trapping results.
:指定されたシグナルのいずれかを受信したときに、シェルに解析とアクションの実行を行わせる。シグナルは、シグナル番号またはシグナル名で指定する。 signalが0またはEXITの場合、シェルが終了したときにアクションが実行される。 actionは空('')でもよく、この場合指定されたシグナルは無視される。 actionが省略されるか`-'に設定されると、指定されたシグナルはそのデフォルトのアクションに設定される。 シェルがサブシェルからフォークするとき、トラップされた(しかし無視されない)シグナルをデフォルトのアクションにリセットする。 trapコマンドは、シェルに入ったときに無視されたシグナルには効果がない。引数なしのtrapは、同じトラップ結果を達成するシェルの入力として適した形式で、シグナルのリストとそれに関連するアクションを標準出力に書き出す。


::Examples:
::Examples:
Line 954: Line 955:
:::trap
:::trap


::List trapped signals and their corresponding action
::トラップされた信号とそれに対応するアクションをリストアップする


:::trap '' INT QUIT tstp 30
:::trap '' INT QUIT tstp 30
Line 965: Line 966:


;type [name ...]
;type [name ...]
:Interpret each name as a command and print the resolution of the command search.  Possible resolutions are: shell keyword, alias, shell builtin, command, tracked alias and not found.  For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed.
:各名前をコマンドとして解釈し、コマンド検索の解決策を表示する。 可能な解決方法は,シェルキーワード,エイリアス,シェル組み込み,コマンド,追跡されたエイリアス,見つからなかった,である。 エイリアスの場合は,エイリアスの展開が表示され,コマンドと追跡エイリアスの場合は,コマンドの完全なパス名が表示される.


;ulimit [-H | -S] [-a | -tfdscmlpnv [value]]
;ulimit [-H | -S] [-a | -tfdscmlpnv [value]]
:Inquire about or set the hard or soft limits on processes or set new limits.  The choice between hard limit (which no process is allowed to violate, and which may not be raised once it has been lowered) and soft limit (which causes processes to be signaled but not necessarily killed, and which may be raised) is made with these flags:
:プロセスのハードリミットやソフトリミットについて問い合わせたり、新たなリミットを設定する。 ハードリミット(どのプロセスも違反することは許されず、一度下げたら上げることはできない)とソフトリミット(プロセスがシグナルを受けるが、必ずしも殺されるわけではなく、上げることができる)の選択は、これらのフラグで行うことができる:


::-H          set or inquire about hard limits
::-H          ハードリミットをセットあるいは問い合わせる


::-S          set or inquire about soft limits.  If neither -H nor -S is specified, the soft limit is displayed or both limits are set.  If both are specified, the last one wins.
::-S          ソフトリミットを設定または問い合わせる。 -Hも-Sも指定しない場合、ソフトリミットを表示するか、両方のリミットが設定される。 両方が指定された場合、最後に指定されたものが優先される。


:The limit to be interrogated or set, then, is chosen by specifying any one of these flags:


::-a          show all the current limits
:そして、これらのフラグのいずれかを指定することで、質問または設定するリミットを選択する:


::-t         show or set the limit on CPU time (in seconds)
::-a         現在制限されているものを表示する


::-f         show or set the limit on the largest file that can be created (in 512-byte blocks)
::-t         CPU時間の制限を表示または設定する(秒単位)。


::-d         show or set the limit on the data segment size of a process (in kilobytes)
::-f         作成できる最大ファイルの上限を表示または設定する(512バイトブロック単位)。


::-s         show or set the limit on the stack size of a process (in kilobytes)
::-d         プロセスのデータセグメントサイズの制限を表示または設定する(キロバイト単位)。


::-c         show or set the limit on the largest core dump size that can be produced (in 512-byte blocks)
::-s         プロセスのスタックサイズの上限を表示または設定する(キロバイト単位)。


::-m         show or set the limit on the total physical memory that can be in use by a process (in kilobytes)
::-c         生成できる最大のコアダンプサイズの制限を表示または設定する(512バイトブロック単位)。


::-l         show or set the limit on how much memory a process can lock with mlock(2) (in kilo‐bytes)
::-m         プロセスが使用できる物理メモリの合計の上限を表示または設定する(キロバイト単位)。


::-p         show or set the limit on the number of processes this user can have at one time
::-l         プロセスが '''[https://manpages.debian.org/bullseye/manpages-dev/mlock.2.en.html mlock]'''(2) でロックできるメモリの上限を表示または設定する (キロバイト単位)。


::-n         show or set the limit on the number files a process can have open at once
::-p         このユーザーが一度に持つことのできるプロセス数の制限を表示または設定する


::-v         show or set the limit on the total virtual memory that can be in use by a process (in kilobytes)
::-n         プロセスが一度に開くことができるファイル数の制限を表示または設定する


::-r         show or set the limit on the real-time scheduling priority of a process
::-v         プロセスが使用できる仮想メモリの合計の上限を表示または設定する(キロバイト単位)。


:If none of these is specified, it is the limit on file size that is shown or set.  If value is specified, the limit is set to that number; otherwise the current limit is displayed.
::-r          プロセスのリアルタイムスケジューリング優先度の上限を表示または設定する


:Limits of an arbitrary process can be displayed or set using the sysctl(8) utility.
:これらのいずれもが指定されない場合、表示または設定されるのはファイルサイズの制限値である。 valueが指定されている場合は、その数値が制限値として設定され、そうでない場合は、現在の制限値が表示される。
 
:'''[[/usr/sbin/sysctl|sysctl]]'''ユーティリティを用いて、任意のプロセスの制限値を表示・設定することができる。


;umask [mask]
;umask [mask]
:Set the value of umask (see umask(2)) to the specified octal value.  If the argument is omitted, the umask value is printed.
:umask ('''[https://manpages.debian.org/bullseye/manpages-dev/umask.2.en.html umask]'''(2)を参照)の値を、指定された8進数の値に設定する。 引数が省略された場合,umaskの値が表示される。


;unalias [-a] [name]
;unalias [-a] [name]
:If name is specified, the shell removes that alias.  If -a is specified, all aliases are removed.
:nameが指定された場合、シェルはそのエイリアスを削除する。 aが指定された場合、すべてのエイリアスが削除される。


;unset [-fv] name ...
;unset [-fv] name ...
:The specified variables and functions are unset and unexported.  If -f or -v is specified, the corresponding function or variable is unset, respectively.  If a given name corresponds to both a variable and a function, and no options are given, only the variable is unset.
:指定された変数と関数はアンセットされ、アンエクスポートされる。 -fまたは-vが指定された場合、それぞれ対応する関数または変数が設定解除される。 与えられた名前が変数と関数の両方に対応し、オプションが与えられていない場合、変数のみがアンセットされる。


;wait [job]
;wait [job]
:Wait for the specified job to complete and return the exit status of the last process in the job.  If the argument is omitted, wait for all jobs to complete and return an exit status of zero.
:指定されたジョブが完了するのを待ち、そのジョブ内の最後のプロセスの終了ステータスを返す。 引数が省略された場合、すべてのジョブの完了を待ち、終了ステータスを0として返す。


=== Command Line Editing ===
=== Command Line Editing ===