How do I delete a Bash function?


Question

I have done this:

bash $ z() { echo 'hello world'; }

How do I get rid of it?

1
166
2/5/2017 8:15:14 PM

Accepted Answer

unset -f z

Will unset the function named z. A couple people have answered with:

unset z

but if you have a function and a variable named z only the variable will be unset, not the function.

252
10/29/2008 12:42:16 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon