This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Ex" text editor – news ·newspapers ·books ·scholar ·JSTOR(December 2012) (Learn how and when to remove this message) |
| ex | |
|---|---|
Screenshot of ex mode opening a file and commands (viaNeovim) | |
| Original author | Bill Joy |
| Initial release | March 9, 1978; 47 years ago (1978-03-09) (as part of 1BSD) |
| Written in | C |
| Operating system | Unix |
| Platform | Cross-platform |
| Type | Text editor |
ex (short forextended)[1][2][better source needed] is aline editor based on and intended as an improvement toed, the originalUnix editor. Today, it is standardized byPOSIX.[3]
George Coulouris ofQueen Mary College developed an improved version of ed called em in 1975 that took advantage ofvideo terminals.[4] While visiting Berkeley, Coulouris presented em toBill Joy, who modified it along with Charles Haley to be less demanding of the processor.[5][6] The editor became ex[7] and got included in theBerkeley Software Distribution.
Later, ex was enhanced to support full-screen editing via a new, visualmode. Thevi text editor is, in fact, ex running in visual mode. The program can be started in either the visual or legacy mode (via commandvi vs.ex) and the user can switch between modes at runtime. And, in visual mode, ex commands can be issued at the colon (:) prompt. Even though vi is just a mode of ex, the editor is more commonly called vi today instead of ex. In fact, some programs such asvim provide both vi and ex compatibility modes such that neither vi nor ex are the program per se.
The core ex commands which relate to search and replace are essential to vi. For instance, the ex command:%s/XXX/YYY/g replaces every instance ofXXX withYYY, and works in vi too. 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 – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Groupex: text editor – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Group