P4V seems to want any substitutions to be whitespace delimited, this can be awkward. For $c, $p, $u you can try checking the existence and values of the corresponding environment variables that P4V sets (P4CLIENT, P4PASSWD, P4USER).