Having a sample function
function functionName ()
{
echo "Hello World"
}
How can I avoid it to be overwritten by a following function with the same name?
function functionName ()
{
echo "this is another function"
}
You need to use the -f option to make corresponding function readonly and syntax is:
readonly -f functionName
After this, if you ever try to update the function an error will be fired:
bash: functionName: readonly function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With