Scripting with Helix 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:

  1. Write a blank job specification into a text file.

    $ p4 job -o > temp1
  2. Make the necessary changes to the job.

    For example:

    $ sed 's/<enter description here>/Crashes on exit./' temp1 > temp2
  3. 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 branch
  • p4 change
  • p4 client
  • p4 job
  • p4 label
  • p4 submit (use p4 change -o to create changelist, or p4 submit -d "A changelist description" to supply a description to the default changelist during changelist submission.)
  • p4 stream
  • p4 user