01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

KSH ( 1) KSH(l)<br />

{ list ; } List is simply executed. Note that { is a keyword and<br />

requires a blank in order to be recognized.<br />

function identifier { list ; }<br />

identifier ( ) { list ; }<br />

Define a function which is referenced by identifier. The<br />

body of the function is the list of commands between {<br />

and } (see Functions below).<br />

time pipeline<br />

The pipeline is executed and the elapsed time as well as<br />

the user and system time are printed on standard error.<br />

The following keywords are only recognized as the first word of a<br />

command and when not quoted:<br />

if then �lse elif fi case esac for while until do done {<br />

} function select time<br />

Comments.<br />

A word beginning with # causes that word and all the following<br />

characters up to a new-line to be ignored.<br />

Ali asing .<br />

The first word of each command is replaced by the text of an<br />

alias if an alias for this word has been defined. The first character<br />

of an alias name can be any printable character, but the rest<br />

of the characters must be the same as for a valid identifier. The<br />

replacement string can contain any valid Korn Shell script including<br />

the metacharacters listed above. The first word of each command<br />

of the replaced text will not be tested for additional aliases.<br />

Aliases can be used to redefine special built-in commands but cannot<br />

be used to redefine the keywords listed above. Aliases can be<br />

created, listed, and exported with the alias command and can be<br />

removed with the unalias command. Exported aliases remain in<br />

effect for sub-shells but must be reinitialized for separate invocations<br />

of the Korn Shell (see Invocation below).<br />

Aliasing is performed when scripts are read, not while they are<br />

executed. Therefore, for an alias to take effect the alias command<br />

has to be executed before the command which references the alias<br />

is read.<br />

Aliases are frequently used as a shorthand for full path names.<br />

An option to the aliasing facility allows the value of the alias to be<br />

automatically set to the full pathname of the corresponding command.<br />

These aliases are called tracked aliases. The value of a<br />

tracked alias is defined the first time the identifier is read and<br />

becomes undefined each time the PATH variable is reset. These<br />

aliases remain tracked so that the next subsequent reference will<br />

redefine the value. Several tracked aliases are compiled into the<br />

shell. The -h option of the set command makes each command<br />

name which is an identifier into a tracked alias.<br />

- 3 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!