Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing a Perforce label's description through a script

I want to modify an existing Perforce label using a script that I can invoke automatically. Currently I know how to do it using the text editor option:

p4 label <label-name>

This opens up a temporary file in my default text editor, I can then enter a description, save the file and close - updates the label successfully.

However, I want to be able to do this automatically using a script. I will have variables that can be used to form my description.

I can use either a shell script or a bat script (on Windows but have Cygwin).

Perforce command line documentation on labels can be found here, but it's not helping me.

Any ideas?

like image 788
Ed . Avatar asked Mar 21 '26 23:03

Ed .


1 Answers

You would do something along those lines:

p4 label -o  > label.txt
sed -i 's/old/new/g' label.txt  # or any other automated method to do the modification
p4 label -i < label.txt

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!