Copy Commands


 

The COPY commands move individual or groups of lines around within the data file and is separated into two types. Type 1 works only with the data on the screen and moves the pointed line to the bottom of the screen and deletes it from the current position. Type 2 works with a copy scratch file (or a specified data file) and copies lines to and/or from that file into the current file. Available commands are:

:C

Copy the pointed line to the bottom of the screen and delete it.

:C{n}

Copy the pointed line and {n}-1 lines to the bottom of the screen and delete them.

:CO{n}

Copies, beginning with the pointed line, n lines to the copy scratch file. The lines are retained within the input file. Any lines present in the copy scratch file are overwritten.

:COD{n}

Copies, beginning with the pointed line, n lines to the copy scratch file. The lines are deleted from the input file. Any lines present in the copy scratch file are overwritten.

:CQ{n}

Copies and appends to the copy scratch file, beginning with the pointed line, {n} lines. The lines are retained within the input file. Any lines present in the copy scratch file are retained.

:CQD{n}

Copies and appends to the copy scratch file, beginning with the pointed line, n lines. The lines are deleted from the input file. Any lines present in the copy scratch file are retained.

:CI

Copies all lines in the copy scratch file into the current input file, placing them following the pointed line.

:CI{n}

Copies, beginning with line {n} and going through all remaining lines in the copy scratch file, into the input file. These new lines are placed following the pointed line.

:CI{n,m}

Copies, beginning with line {n} and continuing through line {m}, into the input file. These new lines are placed following the pointed line.

:CI"{FILENAME}"

Copies all lines in the specified file into the current input file, placing them following the pointed line. This file then becomes the default copy scratch file and is used in all of these commands (:CI, :CO, and :CQ) until another filename is given or the default name is restored.

:CI"{FILENAME}"{n}

Copies, beginning with line {n} and going through all remaining lines in the specified file, into the input file. These new lines are placed following the pointed line. This file then becomes the default copy scratch file and is used in all of these commands (:CI, :CO, and :CQ) until another filename is given or the default name is restored.

:CI"{FILENAME}"{n,m}

Copies, beginning with line {n} and continuing through line {m}, into the input file. These new lines is placed following the pointed line. This file then becomes the default copy scratch file and is used in all of these commands (:CI, :CO, and :CQ) until another filename is given or the default name is restored. The default name of the copy scratch file (upon entry to SUNEDIT) is SCRATCH.C01. When executing all of the :CI, :CO, and :CQ commands, this file is used. This filename may be changed by specifying the filename with any of these commands. That name is retained and used until another filename is given or the default name is restored. The default name (SCRATCH.C01 is restored by typing that name in full or specifying the filename as '*'. The command could look like this:

:CI"*"3,20

 

This would restore the copy scratch filename to SCRATCH.C01 and would then copy in lines 3 through 20 from that file.

Note the following:

  1. All of the :CI, :CO, and :CQ instructions work with (and truncates all records to) 79 bytes.

  2. During execution of the :C, :CO, :CQ, and :CI commands, the pointed line number does not change. The pointer remains with the originally referenced line number on the screen.

  3. The ESCAPE sequence is applicable to all :C commands except for the :C and :Cn commands.

 

 

See Also: Example Commands, SUNEDIT Commands, Line Edit Mode, SUNEDIT

 



System Utilities Copy 1 line Example (:C) Cursor Movement State