Override host to null in perforce client creation

2019-06-24 04:50发布

问题:

I am creating a perforce client using

p4 client -o -t old_client new_client

I want to remove the Host variable from the perforce spec. I tried to override the Host value using

p4 -H '' client -o -t old_client new_client

but still the perforce client is getting created taking the Host info from p4 info command. Any idea how I can remove Host parameter. I am doing this programatically. So, opening the client file and removing Host wont work for me.

回答1:

To remove the Host field from the workspace spec, do:

p4 client -o -t old_client new_client | grep -v Host: | p4 client -i

That is, simply grep out the Host field before submitting the client form back to the server.