Scripting with P4 Server forms
If your scripts issue p4 commands that require the
user to fill in a form, such as the p4 client and
p4 submit commands, use the -o option to
write the form to standard output and the -i option to read
the edited form from standard input.
For example, to create a job using a script on UNIX:
-
Write a blank job specification into a text file.
p4 job -o > temp1
-
Make the necessary changes to the job.
For example:
sed 's/<enter description here>/Crashes on exit./' temp1 > temp2
-
Save the job.
p4 job -i < temp2
To accomplish the preceding without a temporary file, issue the following command:
p4 job -o | sed 's/<enter description here>/Crashes on exit./' | p4 job -i
The commands that display forms are:
p4 branchp4 changep4 clientp4 jobp4 label- p4 submit (use
p4 change -oto create changelist, orp4 submit -d "A changelist description"to supply a description to the default changelist during changelist submission.) p4 streamp4 user