Pre OR post command in CSH HOW?

In sh, bash, ksh, I can use $ trap with the signal DEBUG to get a hook of running command. like:
Code:
my_debug_func () {
xxx
...
}

trap my_debug_func DEBUG
put them in the login shell profile and can get my functions or script run before executing other shell command enter behind the prompt.

How to do that in csh ? csh has no "trap"?!
 
Your best bet would be # onintr [-|label] , but i guess its far from what you were looking for, cause onintr seems to apply to all interrupts, without being able to specify only the ones you want.
 
Yes, I checked out "$ onintr" , it doesn't what i want.

Is there another way ? without using SIGNAL ?
like those functions
Code:
preexec()
precmd()
in Zsh .
 
Oh , Yeah, I found Csh has a "precmd" too !
But base on the action of "precmd" , it should be called "postcmd" !
 
Back
Top