UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: forChapter 4
The Bourne Shell and Korn Shell
Next: Reference: functions
 

function

function name { commands; }

Korn shell only. Define name as a shell function. See the description of semantic issues in the name () entry earlier.

Example

Define a function to count files.

$ function fcount {
>	ls | wc -l
> }


Previous: Reference: forUNIX in a Nutshell: System V EditionNext: Reference: functions
Reference: forBook IndexReference: functions

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System