legacy-knowledge-base
公開されました Jul. 2, 2025

patching-tool を実行すると、予期しないオペレータと不正な置換エラーが発生する

written-by

David Tello

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • patching-tool を実行しようとすると、次のエラーが表示されます。

    $ sh ./patching-tool.sh
    patching-tool.sh: 13: [: unexpected operator
    patching-tool.sh: 13: [: unexpected operator
    patching-tool.sh: 13: [: unexpected operator
    patching-tool.sh: 22: Bad substitution

Environment

  • Liferay DXP 7.0+

解決策

  • これらのエラーは通常、間違ったコマンド インタープリターを使用したことが原因です。
  • patching-tool.sh スクリプトは、BASH コマンド インタープリターの命名法で記述されており、他のインタープリター (DASH など) と互換性がない可能性があります。
  • patching-tool をエラーなしで実行するには、次のオプションを使用できます。
      • $ /patching-tool.sh
      • $ bash ./patching-tool.sh

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base