Glad to see someone working on Solaris. Wondering why you're using the which command, when you just created a "has" function in the other patch segments, and just replaced all the other instances of which.
This is patch 1/3, patch 2/3 creates "has" and uses it here too. Paolo