zsh-users
 help / color / mirror / code / Atom feed
* How do I do 'if X is a function, unfunction it' ?
@ 1998-05-01 15:45 Timothy J Luoma
  1998-05-01 21:15 ` Bart Schaefer
  1998-05-02  3:46 ` Zoltan Hidvegi
  0 siblings, 2 replies; 3+ messages in thread
From: Timothy J Luoma @ 1998-05-01 15:45 UTC (permalink / raw)
  To: zsh-users


Pretty much says it all.

for example, if the command 'cp' has been previously defined as a function,  
then I want to unfunction it

TjL



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I do 'if X is a function, unfunction it' ?
  1998-05-01 15:45 How do I do 'if X is a function, unfunction it' ? Timothy J Luoma
@ 1998-05-01 21:15 ` Bart Schaefer
  1998-05-02  3:46 ` Zoltan Hidvegi
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1998-05-01 21:15 UTC (permalink / raw)
  To: Timothy J Luoma, zsh-users

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
	}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How do I do 'if X is a function, unfunction it' ?
  1998-05-01 15:45 How do I do 'if X is a function, unfunction it' ? Timothy J Luoma
  1998-05-01 21:15 ` Bart Schaefer
@ 1998-05-02  3:46 ` Zoltan Hidvegi
  1 sibling, 0 replies; 3+ messages in thread
From: Zoltan Hidvegi @ 1998-05-02  3:46 UTC (permalink / raw)
  To: Timothy J Luoma; +Cc: zsh-users

> for example, if the command 'cp' has been previously defined as a function,  
> then I want to unfunction it

[[ `type cp` == *' function' ]] && unfunction cp

This works unmodified in ksh too.

Zoli


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-05-02  3:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-01 15:45 How do I do 'if X is a function, unfunction it' ? Timothy J Luoma
1998-05-01 21:15 ` Bart Schaefer
1998-05-02  3:46 ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).