The Built-In Commands

The first set of commands examined in this chapter are built-in commands. A built-in command is part of the shell itself; it is not stored in a separate file on disk. Built-in commands are slightly more efficient than external programs because there is no overhead associated with reading and loading them from a file on disk. Unless you are looping thousands of times, it usually does not matter whether the command you use is built in or external. The built-in commands you will examine are eval, :, and type.

The eval Command

The eval command is used when you want the shell to execute a command after performing substitution. The basic syntax is

eval cmd

Here cmd is any valid shell command. The eval command is normally used ...

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.