JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... での用法においては、 変数(variable) とは 名前 で表現されたパラメータです。 変数は 値 と 0 個以上の 属性 を持ちます。 属性は declare 組み込みコマンド (後述の シェルの組み込みコマンド の declare の項を参照) で設定されます。 パラメータに値が代入されていれば ... 後述する "$@" という例外を除いて、単語の分割は行われません。 パス名展開も実行されません。 代入文は組み込みコマンドの alias , declare , typeset , export , readonly , local の引き数でも使われます。 代入文でシェル変数や配列のインデックスに値を代入する場面では ... ん。 配列 bash は 1 次元のインデックスによる配列と連想配列の変数を扱うことができます。 全ての変数は配列として使用できます。 declare 組み込みコマンドを使えば、明示的に配列を宣言できます。 配列のサイズの上限はありませんし、 メンバのインデックス付けや代入を ... ... ます。 これはwhich そのものを含むシェル関数において、本オプションを合わせて利用すると便利です。 たとえば以下です。 which() { declare -f | which --read-functions $@ } export -f which --skip-functions `--read-functions' が指定されても無視します。 which に対 ... (C シェル) やシェル関数 (Bourne シェル) を追加して利用する方法です。 たとえば以下です。 [ba]sh の場合: which () { (alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@ } export -f which [t]csh の場合: ... ... りも大きい場合、 最後のループ (「トップレベル」のループ) で実行が継続されます。 n が 1 未満の場合を除けば、返り値は 0 です。 declare [ -aAfFgilrtux ] [ -p ] [ name [= value ] ...] typeset [ -aAfFgilrtux ] [ -p ] [ name [= value ] ...] 変数を宣言したり、変 ... ると、 他のオプションで指定された属性を持っている 全ての変数の属性と値を表示します。 -p 以外のオプションが指定されない場合、 declare は全てのシェル変数の属性と値を表示します。 -f オプションは表示をシェル関数に限定します。 -F オプションを指定すると、関数定 ... 名前と行番号も表示されます。 -F オプションを指定すると、 -f オプションも指定したことになります。 -g オプションを指定すると、 declare がシェル関数の中で実行されたときであっても、 グローバルスコープで変数の作成、変更を行います。 ほかの場合には無視されます。 ... ... 2.23 did export an ABI for this system call. Therefore, in order to employ this system call, it was sufficient to manually declare the interface in your code; alternatively, you could invoke the system call using syscall (2). In ancient libc versions (b ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... ... d not cast it to a pointer type matching the payload, but should instead use memcpy (3) to copy data to or from a suitably declared object. * CMSG_LEN () は、 cmsghdr 構造体の cmsg_len メンバにデータを格納する際に必要な値を返す。アラインメントも考慮に入 ... and CMSG_ALIGN () are constant expressions (assuming their argument is constant), meaning that these values can be used to declare the size of global variables. This may not be portable, however. 例 次のコードは、受け取った補助バッファーから IP_TTL オプ ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。