home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


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: for UNIX in a Nutshell: System V Edition Next: Reference: functions
Reference: for Book Index Reference: 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