Chapter 20. Pattern Matching

The UNIX shell must usually expand wildcard filenames for user or shell script commands. Under UNIX, this wildcard expansion is always performed before the command is executed. This simplifies the command, because it sees only the finalized arguments. It also helps to make all commands work consistently, because wildcard expansion is performed in one place only—the shell process.

However, the UNIX environment is a rich environment. If you don't like one shell, you usually can choose from other shell programs. Going a step further, you might choose to write your own. To assist in making these different shell programs behave in the same way for wildcard filenames, two groups of function calls are provided:

  • Functions ...

Get Advanced UNIX Programming 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.