Ex (text editor)
Encyclopedia
ex, short for EXtended, is a line editor
Line editor
A line editor is a text editor computer program that manipulates text primarily by the display, modification, and movement of lines. Line editors precede screen-based text editors and originated in an era when a computer operator typically interacted with a teleprinter , with no video display, and...

 for Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 systems.

The original ex was an advanced version of the standard Unix editor ed
Ed (text editor)
ed is a line editor for the Unix operating system. It was one of the first end-user programs hosted on the system and has been standard in Unix-based systems ever since. ed was originally written in PDP-11/20 assembler by Ken Thompson in 1971...

, included in the Berkeley Software Distribution
Berkeley Software Distribution
Berkeley Software Distribution is a Unix operating system derivative developed and distributed by the Computer Systems Research Group of the University of California, Berkeley, from 1977 to 1995...

. ex is similar to ed, with the exception that some switches and options are modified so that they are more user-friendly.

ex was eventually given a screen oriented visual interface (adding to its command line oriented operation), thereby becoming the vi
Vi
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.The original code for vi...

 text editor. In recent times, ex is implemented as a personality of the vi program; most variants of vi still have an "ex mode
Mode (computer interface)
In user interface design, a mode is a distinct setting within a computer program or any physical machine interface, in which the same user input will produce perceived different results than it would in other settings....

", which is invoked using the command ex, or from within vi for one command by typing the : (colon) character. Although there is overlap between ex and vi functionality, some things can only be done with ex commands, so it remains useful when using vi.

The core ex commands which relate to search and replace are essential to vi. For instance, the ex command issued from vi :%s/XXX/YYY/g replaces every instance of XXX with YYY. The % means every line in the file. The 'g' stands for global and means replace every instance on every line (if it was not specified, then only the first instance on each line would be replaced).

ex has a synonym
Synonym
Synonyms are different words with almost identical or similar meanings. Words that are synonyms are said to be synonymous, and the state of being a synonym is called synonymy. The word comes from Ancient Greek syn and onoma . The words car and automobile are synonyms...

 e in HP-UX
HP-UX
HP-UX is Hewlett-Packard's proprietary implementation of the Unix operating system, based on UNIX System V and first released in 1984...

 environments.

Switches

ex recognises the following switches:
  • - (obsolete) suppresses user-interactive feedback
  • -s (XPG4 only) suppresses user-interactive feedback
  • -l sets lisp editor option
  • -r recover specified files after a system crash
  • -R sets readonly
  • -t tag Edit the file containing the specified tag
  • -v invoke visual mode (vi)
  • -w set window size n
  • -x set encryption mode
  • -C encryption option
  • file specifies file to be edited
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK