Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How do I do 'if X is a function, unfunction it' ?



On May 1, 11:45am, Timothy J Luoma wrote:
> Subject: How do I do 'if X is a function, unfunction it' ?
> 
> for example, if the command 'cp' has been previously defined as a function,  
> then I want to unfunction it

You mean, without getting a "no such hash table element" warning?

How about

	function unfunction() {
	    for i; do
		function $i () { }
		builtin unfunction $i
	    done
	}



Messages sorted by: Reverse Date, Date, Thread, Author