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.
サンプル機能あり
function functionName () { echo "Hello World" }
同じ名前の次の関数によって上書きされないようにするにはどうすればよいですか?
function functionName () { echo "this is another function" }
-f オプションを使用して対応する関数を読み取り専用にする必要があり、構文は次のとおりです。
readonly -f functionName
この後、関数を更新しようとすると、エラーが発生します。
bash: functionName: readonly function