Normally, if I type 'clear' in the shell(zsh), then the contents shown are cleared.
And, here is what I want to do.
If I type 'clear', the shell would be cleared, and also logging some message which I intend to make.
So I fixed .zshrc like below,
clear()
{
read REPLY
if[[[ $REPLY =~ "clear"]]
then
echo "some message"
fi
}
So I expected that if I type 'clear', contents on the shell would be cleared and "some message" would also be prompted.
But only the message "some message" comes out.
How can I read that reserved "clear" command, not the string itself?