|
|
Line 2,328: |
Line 2,328: |
|
| |
|
| ;<nowiki>printf [-v var] format [arguments]</nowiki> | | ;<nowiki>printf [-v var] format [arguments]</nowiki> |
| :Write the formatted arguments to the standard output under the control of the format. The -v option causes the output to be assigned to the variable var rather than being printed to the standard output. | | :フォーマットされた引数を、フォーマットの制御下で標準出力に書き出す。 vオプションを付けると、出力は標準出力に出力されるのではなく、変数varに代入される。 |
|
| |
|
| :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. In addition to the standard printf(1) format specifications, printf interprets the following extensions: | | :すなわち、単純に標準出力にコピーされるプレーン文字、変換されて標準出力にコピーされる文字エスケープシーケンス、および次の連続する引数の印刷を引き起こす各フォーマット指定である。 標準の[[/usr/bin/printf|printf]](1)フォーマット指定に加えて、printfは以下の拡張を解釈する: |
| :;%b | | :;%b |
| ::causes printf to expand backslash escape sequences in the corresponding argument in the same way as echo -e. | | ::printfは、echo -eと同じように、対応する引数のバックスラッシュ・エスケープ・シーケンスを展開する。 |
| :;%q | | :;%q |
| ::causes printf to output the corresponding argument in a format that can be reused as shell input. | | ::printfは、対応する引数をシェル入力として再利用できる形式で出力する。 |
| :;%(datefmt)T | | :;%(datefmt)T |
| ::causes printf to output the date-time string resulting from using datefmt as a format string for strftime(3). The corresponding argument is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no argument is specified, conversion behaves as if -1 had been given. This is an exception to the usual printf behavior. | | ::'''[https://manpages.debian.org/bookworm/manpages-dev/strftime.3.en.html strftime]'''(3) のフォーマット文字列として datefmt を使用した結果の日付時刻文字列を printf に出力させる。 対応する引数は、エポックからの秒数を表す整数である。 2つの特別な引数値を使うことができる: -1 は現在時刻を表し、-2 はシェルが起動された時刻を表す。 引数が指定されない場合、変換は-1が与えられたかのように動作する。 これは、通常のprintfの動作の例外である。 |
|
| |
|
| :The %b, %q, and %T directives all use the field width and precision arguments from the format specification and write that many bytes from (or use that wide a field for) the expanded argument, which usually contains more characters than the original. | | :b、%q、%Tディレクティブはすべて、書式指定のフィールド幅と精度の引数を使用し、拡張された引数からそのバイト数を書き込む(あるいは、その幅のフィールドを使用する)。 |
|
| |
|
| Arguments to non-string format specifiers are treated as C constants, except that a leading plus or minus sign is allowed, and if the leading character is a single or double quote, the value is the ASCII value of the following character.
| | :文字列以外の書式指定子への引数は、Cの定数として扱われる。ただし、先頭のプラス記号またはマイナス記号は許容され、先頭の文字がシングルクォートまたはダブルクォートの場合、値はそれに続く文字のASCII値となる。 |
|
| |
|
| The format is reused as necessary to consume all of the arguments. If the format requires more arguments than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return value is zero on success, non-zero on failure.
| | :書式は、すべての引数を消費するために必要に応じて再利用される。 その書式が,与えられた引数よりも多くの引数を必要とする場合,余分な書式指定は,適切な場合には,ゼロ値またはヌル文字列が与えられたかのように振る舞う。 戻り値は、成功した場合はゼロ、失敗した場合はゼロ以外である。 |
|
| |
|
| ;<nowiki>pushd [-n] [+n] [-n]</nowikI> | | ;<nowiki>pushd [-n] [+n] [-n]</nowikI> |
| ;<nowiki>pushd [-n] [dir]</nowiki> | | ;<nowiki>pushd [-n] [dir]</nowiki> |
| :Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory. With no arguments, pushd exchanges the top two directories and returns 0, unless the directory stack is empty. Arguments, if supplied, have the following meanings: | | :ディレクトリ・スタックの先頭にディレクトリを追加するか、スタックを回転させ、 新しいスタックの先頭を現在の作業ディレクトリにする。 引数がない場合、pushd はディレクトリスタックが空でない限り、上位 2 つのディレクトリを交換し、0 を返す。 引数が与えられた場合、以下の意味を持つ: |
| :;-n | | :;-n |
| ::Suppresses the normal change of directory when rotating or adding directories to the stack, so that only the stack is manipulated. | | ::スタックを回転したり、スタックにディレクトリを追加したりするときに、通常のディレクトリの変更を抑制し、スタックだけを操作するようにする。 |
| :;+n | | :;+n |
| ::Rotates the stack so that the nth directory (counting from the left of the list shown by dirs, starting with zero) is at the top. | | ::スタックを回転させ、n番目のディレクトリ(dirsで示されるリストの左から数えて、ゼロから始まる)が一番上に来るようにする。 |
| :;-n | | :;-n |
| ::Rotates the stack so that the nth directory (counting from the right of the list shown by dirs, starting with zero) is at the top. | | ::スタックを回転させ、n番目のディレクトリ(dirsで示されるリストの右から数えて、ゼロから始まる)が一番上に来るようにする。 |
| :;dir | | :;dir |
| ::Adds dir to the directory stack at the top, making it the new current working di‐ | | ::dirをディレクトリスタックの先頭に追加し、あたかもcd組み込み関数の引数として与えられたかのように、新しいカレント作業ディレクトリとする。 |
| rectory as if it had been supplied as the argument to the cd builtin.
| |
|
| |
|
| :If the pushd command is successful, a dirs is performed as well. If the first form is used, pushd returns 0 unless the cd to dir fails. With the second form, pushd returns 0 unless the directory stack is empty, a non-existent directory stack element is specified, or the directory change to the specified new current directory fails. | | :pushdコマンドが成功した場合、dirsも実行される。 最初の形式を使用した場合、dir への cd が失敗しない限り、pushd は 0 を返す。 2番目の形式では、ディレクトリ・スタックが空であるか、存在しないディレクトリ・スタック要素が指定されるか、指定された新しいカレント・ディレクトリへのディレクトリ変更が失敗しない限り、pushdは0を返す。 |
|
| |
|
| ;<nowiki>pwd [-LP]</nowiki> | | ;<nowiki>pwd [-LP]</nowiki> |
| :Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the -P option is supplied or the -o physical option to the set builtin command is enabled. If the -L option is used, the pathname printed may contain symbolic links. The return status is 0 unless an error occurs while reading the name of the current directory or an invalid option is supplied. | | :現在の作業ディレクトリの絶対パス名を表示する。 Pオプションが指定されているか、set組み込みコマンドの -o物理オプションが有効になっている場合、出力されるパス名にはシンボリックリンクは含まれない。 Lオプションを使用すると、シンボリックリンクを含むパス名が出力される。 カレントディレクトリ名の読み込み中にエラーが発生するか、無効なオプションが指定されない限り、戻りステータスは 0 である。 |
|
| |
|
| ;<nowiki>read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]</nowiki> | | ;<nowiki>read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]</nowiki> |