Reference: name
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T21:58:40Z

#

| Chapter 4 The Bourne Shell and Korn Shell |

## `name`

    name () { commands; }

Define `name` as a function. Syntax can be written on one line or across many. Since the Bourne shell has no aliasing capability, simple functions can serve as aliases. The Korn shell provides the function command, an alternate form that works the same way.

### Example

>     $ count () {
>     > ls | wc -l
>     > }

When issued at the command line, count will now display the number of files in the current directory.

Reference: [[ ]] |  | Reference: alias