p4 opened wasn't being completed
Updated how to get p4 client

Using p4 set with awk is a little more confusing to look at, but it's
a lot faster.
Added __p4_var__ function to replace __p4_client__

__p4_var__ is used to return any Perforce environment variable, such as
P4USER, P4CLIENT, etc.