Corrected some script errors and added checks

flag we should use bash as the shell
P4BRIDGE_CLIENT was incorrectly set as P4BRIDGE
check for open files in perforce before update