Dao Lam
Dao Lam

Reputation: 2937

Scripts to edit a P4 client workspace

I'm writing some script but I need to first get the source code from P4. How do I edit the client workspace in my script?

Here are the steps that I normally take using bash:

export P4CLIENT=myworkspace
p4 client
//now I manually edit the source and destination directory using Vim
p4 sync

Thanks in advance!!!

Upvotes: 1

Views: 5792

Answers (2)

tsimons78
tsimons78

Reputation: 1

I just had to change 98% of my users from "perforce" authentication to "ldap"

I repeated this command for each p4 user:

((p4 user -o %p4user%) | sed "s/perforce/ldap/g") | p4 user -i -f

Upvotes: 0

Barmar
Barmar

Reputation: 781255

p4 client can use standard input and output.

export P4CLIENT=myworkspace
p4 client -o > /tmp/myclient.$$ # Write client to a temp file
# Commands to update /tmp/myclient with the changes you need
p4 client -i < /tmp/myclient.$$
p4 sync
rm /tmp/myclient.$$

Upvotes: 8

Related Questions