Annotation of OpenXM_contrib2/fep/fep.1, Revision 1.1
1.1 ! noro 1: .\" Copyright (c) 1987, 1988 by Software Research Associates, Inc.
! 2: .\" $Header: fep.1,v 4.8 89/01/09 11:15:41 utashiro Exp $
! 3: .\"----------------------------------------
! 4: .TH FEP 1L "5 Aug 1988" "SRA Distribution"
! 5: .SH NAME
! 6: fep \(em general purpose front end processor
! 7: .SH SYNOPSIS
! 8: \fBfep\fR [\|-\fBemacs\fR\||\|-\fBvi\fR\|] \fI\s-1UNIX\s0-command\fR
! 9: .SH DESCRIPTION
! 10: .I Fep
! 11: is a general purpose front end processor applicable to most UNIX commands
! 12: that features \fIvi\fP\|(1)- or \fIemacs\fR\|(1)-like line editing and
! 13: a command history mechanism like that of \fIcsh\fR\|(1).
! 14: .PP
! 15: Choice of editing style is made by selecting either
! 16: the emacs mode or the vi mode
! 17: (named for the editors they emulate),
! 18: specified either by command line option or
! 19: by setting a variable interactively or in the start-up file
! 20: or environment EDITMODE (see editmode variable).
! 21: .PP
! 22: The default key bindings are shown below for both edit modes.
! 23: These can be customized using the fep-bind command.
! 24: .PP
! 25: .B Emacs Bindings
! 26: .PP
! 27: Here follow the default key bindings for the emacs mode.
! 28: Each function name should be self-explanatory.
! 29: The function names are defined as similarly to Gosling's emacs as possible.
! 30: .sp
! 31: .RS
! 32: .nf
! 33: .ta 1.5i
! 34: ^@ mark
! 35: ^A beginning-of-line
! 36: ^B backward-character
! 37: ^D delete-next-character
! 38: ^E end-of-line
! 39: ^F forward-character
! 40: ^I insert-tab
! 41: ^J new-line
! 42: ^K kill-to-end-of-line
! 43: ^L clear-screen
! 44: ^M new-line
! 45: ^N next-history
! 46: ^P previous-history
! 47: ^T previous-history
! 48: ^Y yank-from-kill-buffer
! 49: ^^ toggle-transparency
! 50: ^X-^B show-bindings
! 51: ^X-^H show-history
! 52: ^X-^C terminate
! 53: ^X-^D send-eof
! 54: ^X-^L repaint
! 55: ^X-^V view-buffer
! 56: ^X-( start-script
! 57: ^X-) end-script
! 58: esc-b backward-word
! 59: esc-B backward-word
! 60: esc-d delete-next-word
! 61: esc-D delete-next-word
! 62: esc-f forward-word
! 63: esc-F forward-word
! 64: esc-h delete-previous-word
! 65: esc-H delete-previous-word
! 66: esc-l list-file-name
! 67: esc-L list-file-name
! 68: esc-esc expand-file-name
! 69: esc-? help
! 70: esc-_ invoke-shell
! 71: esc-< search-reverse
! 72: esc-> search-forward
! 73: esc-p insert-previous-history
! 74: esc-n insert-next-history
! 75: esc-. insert-current-history
! 76: .if t .sp .3v
! 77: /* Bindings inherited from the tty driver */
! 78: .if t .sp .3v
! 79: erase delete-previous-character
! 80: kill delete-line
! 81: rprnt reprint
! 82: werase delete-previous-word
! 83: lnext literal-next
! 84: .fi
! 85: .RE
! 86: .sp
! 87: .B Vi bindings
! 88: .PP
! 89: The vi mode has two sub-modes,
! 90: the command mode and the text insert mode.
! 91: The commands of vi are emulated as correctly as possible.
! 92: Here is a list of the default key bindings of the vi mode
! 93: that differ from normal vi commands.
! 94: The tty driver control characters are also inherited in this mode.
! 95: .sp
! 96: .RS
! 97: .nf
! 98: n search-reverse
! 99: N search-forward
! 100: ^A expand-file-name
! 101: ^L list-file-name
! 102: ^N next-history
! 103: ^P previous-history
! 104: ^R reprint
! 105: ^^ toggle-transparency
! 106: ^X-^B show-bindings
! 107: ^X-^C terminate
! 108: ^X-^D send-eof
! 109: ^X-^H show-history
! 110: ^X-^L repaint
! 111: ^X-^X expand-file-name
! 112: ^X-^V view-buffer
! 113: ^X-l list-file-name
! 114: ^X-L list-file-name
! 115: ^X-? help
! 116: ^X-( start-script
! 117: ^X-) end-script
! 118: .fi
! 119: .RE
! 120: .sp
! 121: .B Built-in commands
! 122: .PP
! 123: .I Fep
! 124: has some built-in commands
! 125: that are not passed to the child process but
! 126: understood and processed by fep itself.
! 127: These commands can be issued from the terminal or from the start-up file.
! 128: .RS 3n
! 129: .IP "\fBfep-bind \fIfunction-name key-binding\fR"
! 130: Change key bindings.
! 131: For example,
! 132: to bind the function
! 133: .I list-file-name
! 134: to the string "^X-^X",
! 135: type the following:
! 136: .if t .sp 0.3v
! 137: .if n .sp 1
! 138: \h'\w'MMMMM'u'fep-bind list-file-name "\\^X\\^X"
! 139: .if t .sp 0.3v
! 140: .if n .sp 1
! 141: .PP
! 142: .nf
! 143: \fBfep-alias\fP
! 144: \fBfep-alias\fP \fIname\fP
! 145: \fBfep-alias\fP \fIname string\fP
! 146: .fi
! 147: .RS
! 148: The first form prints all aliases.
! 149: The second form prints the alias for \fIname\fP.
! 150: The last form set the alias for \fIname\fP to \fIstring\fP.
! 151: .PP
! 152: You can refer arguments in command line by !^, !$, !*; they stand for
! 153: first, last, all arguments correspondingly.
! 154: .PP
! 155: To specify multiple commands in one alias, command should be
! 156: separated by semicolon (;) character. For example, next
! 157: description will allow you to execute \fIfep-cd\fP then pass
! 158: cd command to shell when input ``cd'' command.
! 159: .if t .sp .3v
! 160: .if n .sp 1
! 161: \h'\w'MMMMM'u'fep-alias\ cd\ 'fep-cd !$;cd !$'
! 162: .if t .sp .3v
! 163: .if n .sp 1
! 164: Note: \fIFep\fP built-in functions must be defined before normal commands.
! 165: .PP
! 166: If you use
! 167: .I fep
! 168: without \fIauto-tty-fix\fP, following alias could be usefull.
! 169: .if t .sp .3v
! 170: .if n .sp 1
! 171: .nf
! 172: \h'\w'MMMMM'u'if\ $command\ ==\ sh
! 173: \h'\w'MMMMMMMMMM'u'fep-alias\ more\ "fep-command\ more"
! 174: \h'\w'MMMMMMMMMM'u'fep-alias\ vi\ "fep-command\ vi"
! 175: \h'\w'MMMMM'u'endif
! 176: .fi
! 177: .if t .sp .3v
! 178: .if n .sp 1
! 179: .RE
! 180: .IP "\fBfep-unalias\fP \fIlist\fP"
! 181: Remove alias for each name in \fIlist\fP.
! 182: .IP "\fBfep-set\fP \fIvariable = value\fR"
! 183: Set a variable of \fIfep\fP to some value.
! 184: .IP "\fBfep-unset\fP \fIvariable\fR"
! 185: Unset a variable.
! 186: .PP
! 187: \fBfep-cd\fP [ \fIdirectory\fR ]
! 188: .br
! 189: \fBfep-chdir\fP [ \fIdirectory\fR ]
! 190: .RS
! 191: Change directory.
! 192: It sometimes happens that a child process has changed directory,
! 193: but
! 194: .I fep
! 195: is still in the old directory.
! 196: In such a case, neither \fIlist-file-name\fR nor \fIexpand-file-name\fR
! 197: will function as expected.
! 198: This command allows you to change
! 199: .IR fep 's
! 200: current working directory (default = home directory).
! 201: .RE
! 202: .IP "\fBfep-pwd\fP"
! 203: Print
! 204: .IR fep 's
! 205: current working directory.
! 206: .IP "\fBfep-history\fP [ \fInumber of line\fR ]"
! 207: Show the history of commands under
! 208: .IR fep .
! 209: .IP "\fBfep-echo\fP \fIarguments\fR"
! 210: Only print the arguments.
! 211: Variable names can be used prefixed by the "$" character.
! 212: .IP "\fBfep-source\fP \fIfile\fR"
! 213: Read the specified file and execute it.
! 214: The contents of the file are not sent to sub-processes.
! 215: .IP "\fBfep-save-history\fP [ \fInumber of lines to save\fR ] \fIfile\fR"
! 216: Save the current history buffer in the specified file.
! 217: .IP "\fBfep-read-history\fP [ \fIfile\fR ]"
! 218: Read in the command history from the specified file.
! 219: The default file is the value of the \fIhistory-file\fP variable.
! 220: This file name is understood as a path relative to the home directory.
! 221: If you want to specify the name relative to the current directory instead,
! 222: prefix the path by "./".
! 223: .PP
! 224: .nf
! 225: \fBfep-command\fP \fIcommand\fP
! 226: \fBfep-!\fP \fIcommand\fP
! 227: .fi
! 228: .RS
! 229: Execute \fIcommand\fP.
! 230: .RE
! 231: .IP "\fBquit-fep\fP"
! 232: Kill the sub-process and exit.
! 233: .PP
! 234: .IP \fBfep-suspend\fP
! 235: Suspend \fIfep\fP itself. In the unlikely possibility that \fIfep\fP
! 236: falls into a dead-lock in which the sub-processes have stopped but
! 237: \fIfep\fP is still running, use this command to escape from
! 238: the situation.
! 239: .PP
! 240: .nf
! 241: \fBfep-read-from-file\fP \fIfile\fP
! 242: \fBfep-<\fP \fIfile\fP
! 243: .fi
! 244: .RS
! 245: Read data from specified file and send them to sub-process.
! 246: The sub-process will read the data from the file as if they are typed
! 247: at the keyboard.
! 248: .RE
! 249: .PP
! 250: .nf
! 251: \fBfep-read-from-command\fP \fIcommand\fP
! 252: \fBfep-<!\fP \fIcommand\fP
! 253: .fi
! 254: .RS
! 255: Send output of specified command to sub-process.
! 256: .RE
! 257: .PP
! 258: .nf
! 259: \fBfep-start-script [ \fIscript-file\fP ]
! 260: \fBfep-script [ \fIscript-file\fP ]
! 261: .fi
! 262: .RS
! 263: Start to send input and output to a script file.
! 264: If \fIscript-file\fP is specified, it is used.
! 265: If not the value of the variable \fIscript-file\fP will be used.
! 266: .RE
! 267: .PP
! 268: .nf
! 269: \fBfep-stop-script\fP
! 270: .fi
! 271: .RS
! 272: Stop scripting.
! 273: .RE
! 274: .IP "\fBfep-show-bind\fP"
! 275: Print current binding information.
! 276: .IP "\fBfep-repaint\fP [ \fIline\fP ]"
! 277: Repaint last output from command to screen.
! 278: ``\fIline\fP'' specifies number of lines to repaint
! 279: (default is screenful maximum). See also ``\fIauto-repaint\fP'' and
! 280: ``\fIclear-repaint\fP'' variables.
! 281: .RE
! 282: .PP
! 283: .B Control structures
! 284: .RS 3n
! 285: .PP
! 286: .nf
! 287: \fBfep-if\fP \fIexpression\fP
! 288: \fBfep-elseif\fP \fIexpression\fP
! 289: \fBfep-else\fP
! 290: \fBfep-endif\fP
! 291: .fi
! 292: .RS
! 293: Only four control structures are supported but that seems enough.
! 294: .I Expression
! 295: allows only the two operators "==" and "!=".
! 296: Variables can be referenced by prefixing with the "$" character.
! 297: .RE
! 298: .RE
! 299: .PP
! 300: Note:
! 301: The "\fIfep-\fR" prefix of the built-in functions and the above operators
! 302: can be abbreviated in commands that
! 303: .I fep
! 304: executes from a file.
! 305: .RE
! 306: .PP
! 307: .\" ------------------------------------------------------------ Comment
! 308: .B Comment
! 309: .PP
! 310: Lines starting with the character "#" are ignored by
! 311: .IR fep .
! 312: If
! 313: .I fep
! 314: encounters a comment in interaction, it is sent to the sub-process.
! 315: In reading from a file, comments will merely be ignored.
! 316: .PP
! 317: .\" ------------------------------------------------------------ Variables
! 318: .B Variables
! 319: .PP
! 320: .I Fep
! 321: uses some variables.
! 322: .RS 3n
! 323: .ta 3i
! 324: .\"@@@@@
! 325: .IP "\fBalarm-on-eof\fP default: off"
! 326: If this variable is set
! 327: AND the function send-eof is not bound to the eof character
! 328: AND the variable ignore-eof is not set,
! 329: an alarm message will be displayed once
! 330: the first time eof is encountered on an empty line.
! 331: .\"@@@@@
! 332: .IP "\fBauto-repaint\fP default: off"
! 333: If this variable is set, \fIfep\fP automatically repaints the screen
! 334: after restarting.
! 335: .\"@@@@@
! 336: .IP "\fBauto-tty-fix\fP default: on"
! 337: If this variable is set,
! 338: .I fep
! 339: looks at the tty mode of the sub-command,
! 340: and if the tty mode has changed,
! 341: .I fep
! 342: fixes the tty mode of standard out and
! 343: sets the transparency flag according to the mode.
! 344: If this variable is not set, the automatic tty mode check is not done,
! 345: so you have to change the tty mode and transparency explicitly using the
! 346: \fItoggle-transparency\fP function.
! 347: .\"@@@@@
! 348: .IP "\fBbuffer\fP default: 5120"
! 349: Specifies command output buffer size.
! 350: High-watermark used in buffer management mechanism
! 351: will be set 4/5 of this count.
! 352: .\"@@@@@
! 353: .IP "\fBclear-repaint\fP default: off"
! 354: If this variable is set, \fIfep\fP clears the screen before repainting.
! 355: .\"@@@@@
! 356: .IP "\fBcommand\fP default: \fIcommand-name\fR"
! 357: .I Fep
! 358: set this variable to the command name of the sub-process when it starts up.
! 359: .\"@@@@@
! 360: .IP "\fBcrt\fP default: terminal size"
! 361: If set, more message is shown during printing the key bindings
! 362: on each number of line specified by this variable.
! 363: .\"@@@@@
! 364: .IP "\fBdelimiters\fP default: SPACE & TAB"
! 365: The contents of this variable are treated as delimiting characters for
! 366: file name expantion and file name list.
! 367: .\"@@@@@
! 368: .IP "\fBeditmode\fP default: emacs"
! 369: This variable defines the mode for command line editing.
! 370: Key bindings will be set for the appropriate defaults
! 371: when this variable is changed.
! 372: .I Fep
! 373: first looks at the environment variable
! 374: .IR EDITMODE ,
! 375: then looks at any command line arguments,
! 376: and finally reads in the
! 377: .I .feprc
! 378: start-up file.
! 379: .\"@@@@@
! 380: .IP "\fBexpand-tilde\fP default: on"
! 381: .I Fep
! 382: expands "~" to the real home directory name by the expand-file-name function
! 383: when this variable is set.
! 384: .\"@@@@@
! 385: .IP "\fBhistory\fR default: 100"
! 386: .I Fep
! 387: maintains a history file of the length specified by this variable.
! 388: .\"@@@@@
! 389: .IP "\fBhistory-file\fP default: .fephistory"
! 390: Contains the name of the history file for reading from and writing to.
! 391: If the file described by this variable exists,
! 392: .I fep
! 393: will read the file into the history buffer on start up
! 394: and then save the current session's history when it exits.
! 395: .\"@@@@@
! 396: .IP "\fBignore-empty-line\fP default: on"
! 397: If this variable is set, empty command lines are not saved in the history file.
! 398: .\"@@@@@
! 399: .IP "\fBignore-eof\fP default: off"
! 400: .I Fep
! 401: never worries about the eof character if this variable is set.
! 402: .\"@@@@@
! 403: .IP "\fBignore-same-line\fP default: on"
! 404: If this variable is set,
! 405: command lines identical to the previous command line
! 406: are not saved to the history file.
! 407: .\"@@@@@
! 408: .IP "\fBignore-short-line\fP default: on"
! 409: If this variable is set,
! 410: command lines which is shorter than this value
! 411: are not saved to the history file.
! 412: .\"@@@@@
! 413: .IP "\fBnoalias\fP default: off"
! 414: If set, command aliasing won't be done.
! 415: .\"@@@@@
! 416: .IP "\fBprompt\fP default: see below"
! 417: .I Fep
! 418: outputs a prompt after executing built-in functions.
! 419: The default string is set to the NULL string,
! 420: but there are some default prompt strings for some common commands such as
! 421: .I sh, dbx, lpc, mail, "sendmail -bt"
! 422: and
! 423: .I calc.
! 424: However, since
! 425: .I fep
! 426: doesn't care about what program is running,
! 427: the same prompt is still output when you are executing
! 428: .I bc
! 429: from
! 430: .IR sh .
! 431: .br
! 432: You can change the value of prompt and other variables in the start-up file
! 433: as follows:
! 434: .if t .sp .3v
! 435: .if n .sp 1
! 436: .RS
! 437: .DT
! 438: .nf
! 439: \h'\w'MMMMM'u'if $command == sh
! 440: \h'\w'MMMMMMMMMM'u'set prompt = "$ "
! 441: \h'\w'MMMMM'u'endif
! 442: .fi
! 443: .RE
! 444: .ta 3i
! 445: .\"@@@@@
! 446: .IP "\fBsavehist\fR default: off"
! 447: If
! 448: .I savehist
! 449: is set
! 450: .I fep
! 451: saves the number of history entries specified by
! 452: value of this variable in the file named in the variable
! 453: .I history-file
! 454: on terminating.
! 455: .\"@@@@@
! 456: .IP "\fBscript-file\fP default: fepscript"
! 457: This variable is used by the
! 458: .I fep-start-script
! 459: command and by the
! 460: .I start-script
! 461: function.
! 462: .\"@@@@@
! 463: .IP "\fBshell\fR default: /bin/sh"
! 464: Describe the command name to be invoked by
! 465: .IR invoke-shell .
! 466: .\"@@@@@
! 467: .IP "\fBshowhist\fR default: terminal size"
! 468: This variable specifies the number of history lines to be displayed by the
! 469: .I show-history
! 470: function.
! 471: .\"@@@@@
! 472: .IP "\fBtty-fix-bell\fP default: off"
! 473: If this variable is set,
! 474: .I fep
! 475: rings the bell when the tty mode is changed.
! 476: .RE
! 477: .\" ------------------------------------------------------------ Startup file
! 478: .PP
! 479: .B Start-Up File
! 480: .PP
! 481: .I Fep
! 482: executes the file ".feprc" in the home directory of the user
! 483: if it is found there when starting up.
! 484: It looks for arguments on the command line first,
! 485: and only then reads the ".feprc" file,
! 486: so the file has higher priority.
! 487: .\" ------------------------------------------------------------ Functions
! 488: .PP
! 489: .B "Functions"
! 490: .PP
! 491: .ta \w'delete-previous-character\ \ \ 'u
! 492: .RS
! 493: .nf
! 494: abort Abort function
! 495: backward-Word Backward word (non-space)
! 496: backward-character Backward character
! 497: backward-word Backward word (alpha-numeric)
! 498: beginning-of-line Jump to beginning of line
! 499: clear-screen Clear screen
! 500: delete-line Delete whole line
! 501: delete-next-Word Delete next word (non-space)
! 502: delete-next-character Delete next character
! 503: delete-next-word Delete next word (alpha-numeric)
! 504: delete-previous-Word Delete previous word (non-space)
! 505: delete-previous-character Delete previous character
! 506: delete-previous-word Delete previous word (alpha-numeric)
! 507: delete-to-kill-buffer Delete resion to buffer
! 508: end-of-line Jump to end of line
! 509: end-script End script
! 510: expand-file-name Expand file name
! 511: fix-transparency Check tty and change transparency mode
! 512: forward-Word Forward word (non-space)
! 513: forward-character Forward character
! 514: forward-to-end-of-Word Forward to end of word (non-space)
! 515: forward-to-end-of-word Forward to end of word (alpha-numeric)
! 516: forward-word Forward word (alpha-numeric)
! 517: help Show help
! 518: ignore Ignore
! 519: insert-and-flush Insert the character and flush buffer
! 520: insert-tab Insert tab
! 521: invoke-shell Invoke shell process
! 522: kill-to-end-of-line Delete current position to eol
! 523: kill-to-top-of-line Delete tol to current position
! 524: list-file-name List file name
! 525: literal-next Treat next character as literal
! 526: mark Mark position
! 527: new-line Insert newline
! 528: next-history Get next history
! 529: previous-history Get previous history
! 530: insert-next-history Insert next history
! 531: insert-previous-history Insert previous history
! 532: insert-current-history Insert current history
! 533: repaint Repaint screen
! 534: reprint Reprint line
! 535: search-forward Search forward last !history
! 536: search-reverse Search backward last !history
! 537: self-insert Insert the character
! 538: send-eof Send eof
! 539: show-bindings Show binding table
! 540: show-history Show history
! 541: start-script Start script
! 542: suspend Suspend fep
! 543: terminate Terminate fep
! 544: toggle-transparency Change transparency mode
! 545: vi-c Vi c? commands
! 546: vi-d Vi d? commands
! 547: vi-edit Vi edit commands
! 548: vi-ins-edit Vi insert mode
! 549: vi-motion Vi cursor motion commands
! 550: vi-new-line Vi new line
! 551: vi-num Vi prefix number
! 552: view-buffer View buffer
! 553: yank-from-kill-buffer Yank from kill buffer
! 554: .fi
! 555: .RE
! 556: .PP
! 557: Probably only the function name "\fItoggle-transparency\fR"
! 558: is hard to understand.
! 559: This function is provided for entering non-line-oriented tools
! 560: from a line-oriented tool using
! 561: .IR fep .
! 562: Assume a situation where you are using
! 563: .IR sh (1)
! 564: with
! 565: .IR fep ,
! 566: and then invoke
! 567: .IR vi (1).
! 568: Since
! 569: .I fep
! 570: intercepts all input for editing,
! 571: .I vi
! 572: cannot work correctly.
! 573: You can escape from this annoying situation using the
! 574: "\fItoggle-transparency\fR" function which is bound to the
! 575: .I Control-^
! 576: key by default.
! 577: Of course, it is also necessary to return to the normal mode after exiting vi.
! 578: .PP
! 579: Note, however, that this tty mode fix can also be done automatically.
! 580: If the
! 581: .I auto-tty-fix
! 582: variable is set,
! 583: .I fep
! 584: looks at the tty mode of the sub-command and fixes the tty mode of standard
! 585: input accordingly.
! 586: .SH "OTHERS"
! 587: .PP
! 588: .I Fep
! 589: can handle SHIFT-JIS kanji code if compiled with the -DKANJI flag.
! 590: .SH "SEE ALSO"
! 591: newcsh(1)
! 592: .SH COPYRIGHT
! 593: Copyright (c) 1987, 1988 by Software Research Associates, Inc.
! 594: .br
! 595: Distribution without fee is allowed as long as
! 596: all copyright notices are included.
! 597: .SH AUTHOR
! 598: K. Utashiro
! 599: .br
! 600: Software Research Associates, Inc., Japan.
! 601: .RS
! 602: .nf
! 603: .ta \w'JUNET: 'u
! 604: UUCP: kddlab!srava.sra.junet!utashiro
! 605: ARPA: utashiro%sra.junet@uunet.uu.net
! 606: JUNET: utashiro@sra.junet
! 607: .fi
! 608: .RE
! 609: .SH FILES
! 610: .ta \w'~/.feprc,\ ./.feprc\ \ \ 'u
! 611: .nf
! 612: \^~/.feprc,\ ./.feprc start-up file
! 613: \^~/.fephistory default history file
! 614: \^./fepscript default script file
! 615: .fi
! 616: .SH BUGS
! 617: .PP
! 618: While working on the program the author sometimes lost his mind,
! 619: whereupon so did the program.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>