Академический Документы
Профессиональный Документы
Культура Документы
Shell Basics
POSIX shell
The POSIX shell is a POSIX-compliant command programming language and commands interpreter. It can execute commands read from a terminal or a file. It contains a history mechanism, supports job control, and provides various other useful features.
Korn Shell
The Korn shell is a command programming language and commands interpreter. It can execute commands read from a terminal or a file. Like the POSIX shell, it contains a history mechanism, supports job control and provides various other useful features. The Korn shell was developed by David Korn of AT&T Bell Labs.
Bourne shell
Lacks many features contained in the POSIX and Korn shells. Developed by Stephen R. Bourne It was the original shell available on the AT&T releases of UNIX
C Shell
A command language interpreter that incorporates a command history buffer C-language-like syntax, and job control facilities developed by William Joy of the University of California at Berkeley
Description
A feature allowing commands to be stored in a buffer, then modified and reused
The ability to modify the current or previous command lines with a text editor
Posix
Bour ne
Kor n
Yes
Yes
No
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Restricted shells
Job control
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Aliasing
An alias is a new name for a command Syntax: $ alias [name[=string]] Example: $ alias dir=ls $ alias d=ls l $ alias mroe=more alias - displays aliases currently defined $ alias
Command History
The shell keeps a history file of commands that you enter. The history command displays the last 16 commands. You can recall, edit, and re-enter previously entered commands Syntax: $ history [-n| a z]
Re-entering commands
Type r c to re-enter command number c
Example: $ history 3 5 $ r 4
Recalling Commands
Uses the history mechanism Must have the EDITOR environment variable set. $ EDITOR=vi $ export EDITOR -At $, press ESC and use normal vi commands to scroll through previous commands. k -scrolls backwards j -scrolls forward -Press RETURN to execute the command.