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

variable containing the current command



Is there a zsh environment variable that contains the current command
so that it can be referenced in preexec() or precmd() (or ideally both)?

e.g.

precmd() { echo "Just did:$CURRENT_CMD" }
preexec() { echo "Ready to do:$CURRENT_CMD" }

localhost[1]% ls
Ready to do:ls
foo		bar		snafu		tarfu
Just did:ls
localhost[2]%

Ben
-- 
Benjamin Korvemaker
benjamin@xxxxxxxxxxxxxx
	I have yet to meet a C compiler that is more friendly
	   and easier to use than eating soup with a knife.



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