What is the problem exactly? Your script already traps signal 20.
However, exit code 20 is something entirely different than signal 20. Trapping pseudo-signal 0 allows you to perform an action when the script terminates (regardless of the exit code).
If you are expecting "exit 20" to generate the signal, it doesn't work that way. A signal (an interrupt) is something generated by an external event; this is what you can "catch" with the trap keyword. You can generate the signal by hand with kill -s 20 (processid) to trigger the trap. I'm guessing that is not the problem you want to solve in the first place, though, based on your script and your question.
Again, coincidentally, you can set up a trap to handle "signal" 0 (there is no such signal, per se, it's just a special case of trap), however. It will not care what number you use after exit but execute whenever the script exits.
#!/bin/sh
trap ketchup 0
ketchup () {
cat t.log
echo caught
exit $?
}
if echo ABCDEFGHORA|grep -is "ORA" >/dev/null; then
echo Found
else
echo Not found
fi >>t.log
No explicit exit is required, either; the event will trigger when the script simply ends.
I made some stylistic changes to the conditional logic as well.