Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Reference | 2025.1

# Edit specs and workspace alias files

Consider the advanced uses of command aliases.

## Editing specifications

The `p4subst` special operator:

- Allows you to edit specs.

- Has an effect that is similar to the following command in a shell pipeline:
  `| sed 's/regular_expression/literal/g'`

You can use the `p4subst` special operator in an alias as follows:

Copy

    something &gt; $(output) &amp;&amp;
    p4subst "regular expression" "literal replacement" &lt; $(output) &gt; $(result) &amp;&amp;
    something else &lt; $(result)

For example, consider the string substitution in the alias:

Copy

    newChange $(desc) = change -o &gt; $(chg) &amp;&amp;
                       p4subst "$(LT)enter.*$(GT)" $(desc) &lt; $(chg) &gt; $(chg2) &amp;&amp;
                       change -i &lt; $(chg2)

The alias replaces the default change description with the argument provided to `p4 newChange description`.

## Creating alias files for each workspace

You can have a P4ALIASES file that is specific to this client workspace and that is found no matter where you are in the client workspace

To create an alias file for each workspace, add the following line to your `P4CONFIG` file:
`P4ALIASES=$configdir/p4aliases.txt`

Your search for returned results