Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

p4 command not found

I'm trying to use p4 commands in my batch files on Mac like p4 login etc. I keep getting the error "-bash p4: command not found".

I followed the top 7 steps here and got the same error: http://www.endlesslycurious.com/2008/11/11/configuring-p4-command-line-client-on-mac-os-x/

I couldn't find anything else useful when searching. Has anyone else encountered a similar issue and resolved it?

like image 517
Chris Moore Avatar asked Aug 01 '13 15:08

Chris Moore


People also ask

How do you check if Perforce is installed?

You can verify it is running by going to Control Panel > System and Security > Administrative Tools > Services, and scroll down to Perforce.

How do I run a P4V command?

Quick start with p4Open p4v (visual Perforce client). Right click on the project folder. Click "Open Terminal". Now you can use p4 in a preconfigured console, you don't need to setup workspace and server connection.

How do I check my $p4port?

To verify a connection, run the p4 info command. The Server address: field shows the host to which p4 connected and also displays the host and port number on which the Helix Server is listening.


2 Answers

Just drop the "p4" executable in /usr/local/bin or even /usr/bin if you prefer. ;-)

like image 92
Lester Cheung Avatar answered Nov 07 '22 02:11

Lester Cheung


How-To steps:

(1) Download p4 file for macOS from:

https://www.perforce.com/downloads/helix-command-line-client-p4

(2) Copy the item to any local folder under any custom folder. For ex: '/Users//perforce'

(3) Run the following commands in terminal.

chmod +x /Users/<yourname>/perforce/p4
export PATH=/Users/<yourname>/perforce:$PATH

(4) Now run 'p4' in terminal.

This should not fail!

like image 40
ChaM Avatar answered Nov 07 '22 02:11

ChaM