|Previous||Table of Contents||Next|
Vi Editing Mode
To edit commands saved in your history file simply press the Escape key. You are now in vi command mode. If you want to make a correction to the previous command simply press k. Now move around on the line using vi commands. Make changes to the line then press Return. You don't have to press Esc before pressing Return.
For further information about editing the history file using vi commands refer to Module 50.
The vi editor is described in Module 151.
There are two types of UNIX commands: internal and external commands. Internal commands are part of the ksh. They are executed within the shell itself. No new process has to be spawned, no code has to be read from disk and loaded into memory, and no PATH searching is performed. Therefore, internal commands are executed much faster than external commands.
Except for the following two internal commands, all internal commands have been placed in a module of their own name or in the Programming Constructs module.
|.||The dot command. The dot command executes a shell script in the current environment. The shell script is read just as if you had typed all the lines at your terminal, without a new child process being started. Usually, a shell script is executed in a subshell (a child process is started) and changes to the environment do not affect the current shell. The dot command circumvents this restriction. Therefore, any environmental changes made in the shell script executed by the dot command will be reflected in the current shell environment.|
|:||The colon command. The colon command is the same as the true command. It does nothing. It always returns a 0 exit status. It is often used in while loops or if statements to fill a required command position. For example,|
while : do echo "Stuck in an infinite loop." done
|is just one of many ways to use the colon command.|
|The C shell uses the source command to perform the dot (.) command function used by the ksh.|
The procedures that are followed by the shell to execute a command are described in Module 23.
DIAGNOSTICS AND BUGS
Users often have the problem of the shell appearing to be hung or not responding. There are several situations to be aware of and solutions to each.
The first situation is the Ctrl-S and Ctrl-Q dilemma. If you type input on the keyboard and there is no response, first press Ctrl-Q to resume output to your terminal. If this does not work, the system may be extremely slow, in which case you must be patient.
Another possibility is the shell or last program you executed is hung. Try pressing Delete two or three times. If you are in applications, you might try pressing Esc or Ctrl-D depending on the application's required interrupt or attention key.
Refer to the following modules.
|Module||Module Name||Module||Module Name|
|67||I/O and Redirection||141||trap|
The following list describes the files the ksh command uses.
|standard input||Reads from the terminal keyboard or the output of a pipe.|
|standard output||Writes to the terminal screen or the input of a pipe.|
|standard error||Writes errors to the terminal screen or the input of a pipe.|
|/etc/profile||Executes the commands stored in this file during login to perform common system login procedures.|
|/etc/alias||Executes the commands stored in this file during login to set up common aliases.|
|$HOME/.profile||Executes the commands stored in this file during login to set up user-defined environment.|
|$ENV||Executed each time a new ksh is spawned.|
|Used for the history file, some implementations use sh* instead of ksh*.|
|/dev/null||The system trash can, used to dump unwanted output.|
|/etc/passwd||Used to find home directories for ~name substitutions.|
|Previous||Table of Contents||Next|