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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.