ED.1
资源名称:os_source.zip [点击查看]
上传用户:datang2001
上传日期:2007-02-01
资源大小:53269k
文件大小:2k
源码类别:
操作系统开发
开发平台:
C/C++
- ED(1) Minix Programmer's Manual ED(1)
- NAME
- ed - editor
- SYNOPSIS
- ed file
- OPTIONS
- - Suppress line/byte count messages (for in scripts)
- EXAMPLES
- ed prog.c # Edit prog.c
- echo '1,$p' | ed - file
- # Odd way to write 'cat file'
- DESCRIPTION
- Ed is functionally equivalent to the standard V7 editor, ed. It supports
- the following commands:
- (.) a: append
- (.,.) c: change
- (.,.) d: delete
- e: edit new file"
- f: print name of edited file"
- (1,$) g: global command
- (.) i: insert
- (.,.+1) j: join lines together
- (.) k: mark
- (.) l: print with special characters in octal
- (.,.) m: move
- (.,.) p: print
- q: quit editor"
- (.) r: read in new file
- (.,.) s: substitute
- (1,$) v: like g, except select lines that do not match
- (1,$) w: write out edited file
- Many of the commands can take one or two addresses, as indicated above.
- The defaults are shown in parentheses. Thus a appends to the current
- line, and g works on the whole file as default. The dot refers to the
- current line. Below is a sample editing session with comments given
- following the # symbol.
- ed prog.c # Edit prog.c
- 3,20p # Print lines 3 through 20
- /whole/ # Find next occurence of whole
- s/whole/while/ # Replace whole by while
- g/Buf/s//BUF/g # Replace Buf by BUF everywhere
- 1
- ED(1) Minix Programmer's Manual ED(1)
- w # Write the file back
- q # Exit the editor
- Ed is provided for its sentimental value. If you want a line-oriented
- editor, try ex. If you want a good editor, use elle, elvis, or mined.
- SEE ALSO
- elvis(1), elle(9), mined(9).
- 2