cat

get the contents of a version of an element

Usage

accurev cat [ -v <ver-spec> ] [ -p <depot-name> ] { <element> | -e <eid> }

Description

Note: As an alternative to “cat”, you can use the Windows-friendly command-name “type”.

The cat command retrieves the contents of a particular version of a file element from depot storage in the AccuRev repository. Exception: if you omit the -v option, it uses the contents of the file in your workspace tree (on the client machine) rather than going to the repository (on the server machine).

cat displays the data — i.e. sends it to the stdout device. You can use ordinary command-shell program techniques to pipe or redirect the data.

This command follows element links and symbolic links, displaying the contents of the target element.

Options

-v <ver-spec>

Display a particular version of the element, instead of the file in your workspace tree. See Using a Specific Version of an Element for a description of the forms that <ver-spec> can take.

For an element link, this option specifies a version of the link element. The current content of the element targeted by the specified version of the element link is displayed.

-p <depot-name>

Specify the depot in which the element resides. The option is required only if the current working directory is not within a workspace for that depot, and you use a stream-number with -v instead of a stream-name. When using this option, you cannot specify the element with a simple filename; use its depot-relative pathname (or its element-ID) instead.

-e <eid>

Operate on the file element with the specified element-ID. You can use this option instead of specifying the name of an element.

Examples

Display version 3 in stream bubble_mary of file foo.c:

   > accurev cat -v bubble_mary/3 foo.c

Display the version of file foo.c that is currently used by stream shell_john:

   > accurev cat -v shell_john foo.c

Display the version in stream gizmo_dvt_derek of the file whose element-ID is 4056:

   > accurev cat -v gizmo_dvt_derek -e 4056

Display the content of the element link mylink as of version 6/2:

   > accurev cat -v 6/2 -e mylink

If version 6/2 of mylink pointed to a file comment.txt that contained //10-Jan-2013 when the link was created, but the latest version now contains //10-Nov-2013, the command returns //10-Nov-2013. Even if mylink has a later version pointing to a different file, the command will return the contents of the latest version of the file pointed to by version 6/2.

See Also

pop