[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 INed Editor User's Guide

Chapter 10. Running AIX and Filter Commands

You can run AIX commands either by putting the file you are editing on hold while the command runs or by running the command in a box. Filters are programs that take standard input, transform it in some way, and write to standard output. For example, you can use filter commands to replace specified text in a paragraph or file or to sort text into alphabetic or arithmetic order.

How to Run AIX Commands and Filter Commands from the INed Editor

You can use the following procedures with INed editor subcommands:

To Run AIX Commands

  1. Press the F2 key (the Menu function).

    The editor displays the New Task menu. The New Task menu lets you run operating system commands without leaving the editor.

  2. Move the cursor to one of the following options, and press the Ctrl-A, Enter key sequence (the Execute function):

If you select the Execute AIX shellcommands option, the editor displays the message Saving file (the wording of this message may vary) and displays a shell prompt. Enter an operating system command or commands at the shell prompt. Press the Ctrl-D key sequence (the shell command to exit) to resume editing.

To Run AIX Commands in a Box

If you select Run an AIX Shell Command within a Box option, the editor displays the Shell command box. Type an operating system command in the box and press the Ctrl-A, Enter key sequence (the Execute function). The editor displays the message Executing and, when the command completes, displays the results of the operating system command in a box. If the command has no output, the editor displays the message No output .

Note: You can also run an operating system command in a box by pressing the Ctrl-A, Enter key sequence (the Enter function), typing the command in the ENTER box, and pressing the F2 key (the Menu function). The editor displays the message Executing (the wording of this message may vary) and displays the results in a box.

To Run Filter Commands

  1. Press the Ctrl-A, Enter key sequence (the Enter function), and type the filter command in the ENTER box.

    Filters are commands that change files. For example, the rpl command is the INed editor filter command to replace text in a file. Some other useful operating system filter commands are the nl, sort, and tr commands. You can also use many other operating system commands as filters. For more information on commands, see Editor Commands.

  2. Press the Ctrl-A, X key sequence (the Do function).

    The editor uses the following conventions when it runs a filter command:

    To stop a filter command before it completes processing, press the Ctrl-C key sequence (the Break function). The editor displays a message like Filter stopped . If the command completes before you press the Ctrl-C key sequence (the Break function), the operation is not canceled or undone.
    Note: Some keyboards have Break engraved on the top of a key. This key does not necessarily issue the Break function.

To Perform a Simple Sort or Sort Numerically

  1. Put the cursor on the first line you want to sort, and press the Ctrl-A, Enter key sequence (the Enter function).

  2. To perform a simple sort, type sort in the ENTER box.

    To sort numerically, type the following in the ENTER box:

    sort -n 
    The sort command has other flags that you can use to sort lines.

  3. Press the Ctrl-A, X key sequence (the Do function).

    The editor displays the sorted lines in ascending or arithmetic order.

To Replace Text from the Current Line to the End of the Paragraph, by Paragraphs, or by Lines

  1. Press the Ctrl-A, Enter key sequence (the Enter function).

  2. To replace text from the current line to the end of the paragraph, type the following in the ENTER box, and press the Ctrl-A, X key sequence (the Do function):
    rpl OldText NewText 
    where OldText is the text you want to replace and NewText is the new text.

    To replace text by paragraphs or by lines, type the following in the ENTER box:

    Number rpl OldText NewText 
    where Number is either the number of paragraphs or the number of lines you want to search, OldText is the text you want to replace, and NewText is the new text.

    Text can consist of either one word or a phrase. For example, you can replace the word priority with the phrase order of importance . Use the following guidelines when you type text for the rpl command:

Related Information

The cat command, nl command, rpl command, sort command, tr command in AIX Version 4.3 Commands Reference.

INed Overview introduces general concepts about the INed editor, lists the INed editing functions and describes the system guidelines for using the INed editor.

INed Editor Functions for the Standard Keyboard is a table that shows the INed editor command keys on a standard keyboard.

INed Editor Files in AIX Version 4.3 Files Reference contains reference information about the files used by the INed editor.

Editor Commands contains a list, with brief descriptions, of the editor commands.


[ Previous | Next | Contents | Glossary | Home | Search ]