POSIX はシェルではありません
## Japanese Translation:
真のシェルの移植性を達成するには、"'POSIX 準拠'というラベルに頼ることだけで十分ではない」ことが必要です。Bash や Dash など主要な実装は POSIX が一部の振る舞い(例えば `echo` のバックスラッシュエスケープなど)を実装定義とすることを認めているにもかかわらず、コマンドを異なって解釈するためです。例えば、`\n` の扱いがシェル間で異なるほか、`[[ ]]` といった Bash 固有の構文は、Ubuntu や Alpine Linux などに存在する Dash などのミニマルな実装に対する `/bin/sh` の設定があるシステムでは、沈黙した失敗を引き起こすことがよくあります。これらの不一致は、単なるバグではなく、異なる標準バージョンを経て蓄積された歴史的判断に起因しており、自然言語の方言的な変異と似ています。コミュニティは頻繁に、準拠とは CI テストを通過することや Bash のオプション(例: `-e`)を使用することと混同しており、それは厳格な移植性を保証しません。`shell-docs` などのツールを用いて 14 つのシェルにわたる機能を検証した実験が示す通り、変数の作用域のような一貫性のある要素であっても分岐することがあります。したがって、開発者は準拠を前提とする姿勢から、Ubuntu、macOS、Alpine、企業向け Linux など特定の `/bin/sh` バリエーションを含む多様な現実環境でスクリプトを能動的に検証する姿勢へと移行し、構文が同等の結果を与えない場合の広範な本番環境での失敗を防ぐ必要があります。
## Text to translate:
To achieve true shell portability requires more than relying on "POSIX compliant" labels, as major implementations like Bash and Dash interpret commands differently despite POSIX leaving certain behaviors (such as `echo` backslash escapes) implementation-defined. For example, handling of `\n` varies between shells, and Bash-exclusive constructs like `[[ ]]` often cause silent failures on systems where `/bin/sh` points to minimal implementations like Dash found in Ubuntu or Alpine Linux. These discrepancies stem from accumulated historical decisions across different standard versions rather than simple bugs, similar to dialectical variations in natural languages. The community frequently conflates compliance with passing CI tests or using Bash options like `-e`, which does not guarantee strict portability. As shown by experiments with tools like `shell-docs` validating features across 14 shells, even seemingly consistent elements like variable scoping can diverge. Consequently, developers must shift from assuming compliance to actively verifying scripts across diverse real-world environments—such as the specific `/bin/sh` variants found in Ubuntu, macOS, Alpine, and enterprise Linux—to prevent widespread production failures where syntax does not yield identical results.