GNU Readline Library
Edition5.0,for Readline Library Version5.0.
January2004 Chet Ramey,Ca Western Rerve University
Brian Fox,Free Software Foundation
This manual describes the GNU Readline Library(version5.0,28January2004),a library which aids in the consistency of ur interface across discrete programs which provide a command line interface.
Copyright c 1988-2004Free Software Foundation,Inc.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are prerved on all copies.
Permission is granted to copy,distribute and/or modify this document under
the terms of the GNU Free Documentation Licen,Version1.1or any later
version published by the Free Software Foundation;with no Invariant Sections,
with the Front-Cover texts being“A GNU Manual,”and with the Back-Cover
Texts as in(a)below.A copy of the licen is included in the ction entitled
“GNU Free Documentation Licen.”
(a)The FSF’s Back-Cover Text is:“You have freedom to copy and modify
this GNU Manual,like GNU software.Copies published by the Free Software
Foundation rai funds for GNU development.”
Published by the Free Software Foundation
59Temple Place,Suite330,
Boston,MA02111-1307
USA
i Table of Contents
1Command Line Editing (1)
1.1Introduction to Line Editing (1)
1.2Readline Interaction (1)
1.2.1Readline Bare Esntials (1)
1.2.2Readline Movement Commands (2)
宋代词人1.2.3Readline Killing Commands (2)
1.2.4Readline Arguments (3)
托运行李英文
1.2.5Searching for Commands in the History (3)
1.3Readline Init File (4)
1.3.1Readline Init File Syntax (4)
1.3.2Conditional Init Constructs (9)
秋雨诗词
1.3.3Sample Init File (10)
1.4Bindable Readline Commands (13)
1.4.1Commands For Moving (13)
1.4.2Commands For Manipulating The History (13)
1.4.3Commands For Changing Text (14)
1.4.4Killing And Yanking (16)
1.4.5Specifying Numeric Arguments (17)
1.4.6Letting Readline Type For You (17)
1.4.7Keyboard Macros (17)
1.4.8Some Miscellaneous Commands (18)
1.5Readline vi Mode (19)
2Programming with GNU Readline (21)
2.1Basic Behavior (21)
2.2Custom Functions (22)
工伤怎么报销2.2.1Readline Typedefs (22)
2.2.2Writing a New Function (23)
2.3Readline Variables (24)
2.4Readline Convenience Functions (28)
2.4.1Naming a Function (28)
将欲辞君挂帆去
2.4.2Selecting a Keymap (28)
2.4.3Binding Keys (29)
2.4.4Associating Function Names and Bindings (31)
2.4.5Allowing Undoing (31)
2.4.6Redisplay (32)
2.4.7Modifying Text (34)
2.4.8Character Input (34)
2.4.9Terminal Management (35)
2.4.10Utility Functions (35)
2.4.11Miscellaneous Functions (36)
2.4.12Alternate Interface (37)
2.4.13A Readline Example (38)
ii GNU Readline Library
2.5Readline Signal Handling (39)
2.6Custom Completers (41)
2.6.1How Completing Works (41)
2.6.2Completion Functions (42)
2.6.3Completion Variables (43)
2.6.4A Short Completion Example (47)
比熊和泰迪的区别
Appendix A Copying This Manual (57)
A.1GNU Free Documentation Licen (57)
A.1.1ADDENDUM:How to u this Licen for your
documents (63)
Concept Index (65)
描写山的优美句子Function and Variable Index (67)
Chapter1:Command Line Editing1
1Command Line Editing
This chapter describes the basic features of the gnu command line editing interface. 1.1Introduction to Line Editing
The following paragraphs describe the notation ud to reprent keystrokes.
The text C-k is read as‘Control-K’and describes the character produced when the k key is presd while the Control key is depresd.
The text M-k is read as‘Meta-K’and describes the character produced when the Meta key(if you have one)is depresd,and the k key is presd.The Meta key is labeled ALT on many keyboards.On keyboards with two keys labeled ALT (usually to either side of the space bar),the ALT on the left side is generally t to work as a Meta key.The ALT key on the right may also be configured to work as a Meta key or may be configured as some other modifier,such as a Compo key for typing accented characters.
If you do not have a Meta or ALT key,or another key working as a Meta key,the identical keystroke ca
n be generated by typing ESC first,and then typing k .Either process is known as metafying the k key.个人原因辞职信20字
The text M-C-k is read as‘Meta-Control-k’and describes the character produced by metafying C-k.
In addition,veral keys have their own names.Specifically, DEL , ESC , LFD , SPC , RET ,and TAB all stand for themlves when en in this text,or in an initfile(e Section1.3[Readline Init File],page4).If your keyboard lacks a LFD key,typing C-j will produce the desired character.The RET key may be labeled Return or Enter on some keyboards.
1.2Readline Interaction
Often during an interactive ssion you type in a long line of text,only to notice that the first word on the line is misspelled.The Readline library gives you a t of commands for manipulating the text as you type it in,allowing you to justfix your typo,and not forcing you to retype the majority of the line.Using the editing commands,you move the cursor to the place that needs correction,and delete or inrt the text of the corrections.Then, when you are satisfied with the line,you simply press RET .You do not have to be at the end of the line to press RET ;the entire line is accepted regardless of the location of the cursor within the line.
1.2.1Readline Bare Esntials
In order to enter characters into the line,simply type them.The typed character appears where the cursor was,and then the cursor moves one space to the right.If you mistype a character,you can u your era character to back up and delete the mistyped character.
Sometimes you may mistype a character,and not notice the error until you have typed veral other characters.In that ca,you can type C-b to move the cursor to the left,and then correct your mistake.Afterwards,you can move the cursor to the right with C-f.