Bashの文字列の定義は何ですか?

Bashの文字列の定義は何ですか?

Bashの文字列の定義は何ですか?

Bash は、文書のさまざまな場所で「文字列」という用語を使用します。たとえば、=~正規表現の照合に使用される文書演算子に使用されます。

==と!=と同じ優先順位を持つ追加の2項演算子=~を使用することもできます。使用すると、ひも演算子の右側はPOSIX拡張正規表現として扱われ、それに応じて一致します(regex(3)のように)。

このセクションにはDEFINITIONS文字列定義はありません。

DEFINITIONS
       The following definitions are used throughout the rest of this document.
       blank  A space or tab.
       word   A sequence of characters considered as a single unit by the shell.  Also known as a token.
       name   A word consisting only of alphanumeric characters and underscores, and beginning with an alphabetic character or an underscore.  Also referred to as an identifier.
       metacharacter
              A character that, when unquoted, separates words.  One of the following:
              |  & ; ( ) < > space tab newline
       control operator
              A token that performs a control function.  It is one of the following symbols:
              || & && ; ;; ;& ;;& ( ) | |& <newline>

それでは、Bashの文字列は正確に何ですか?IFS環境変数にスペースや文字を含めることはできますか?

注:文字列は通常、アルファベットの一連の記号として定義されていることがわかります。

ベストアンサー1

Bashマニュアルは文字列を定義しませんが、それはそう言う

これは、IEEE POSIX 仕様 (IEEE 標準 1003.1) の IEEE POSIX シェルおよびツール部分を一貫して実装するためのものです。

だから我々は仮定することができます文字列のPOSIX定義適用可能:

最初のヌルバイトで終わり、それを含む連続バイトシーケンス。

おすすめ記事