Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Bashスクリプトには、同じように見える2つの異なる形式があります。
`some command`
と
$(some command)
この2つの違いは何ですか?また、それぞれをいつ使用する必要がありますか?
セマンティックな違いはありません。バッククォートの構文は、古くてそれほど強力ではないバージョンです。manbashのセクション「コマンド置換」を参照してください。
シェルが構文をサポートしている場合は、$()ネストできるため、構文を優先してください。
$()