Learning shell interpretation of commands

When we log in, the $ sign will be visible in the shell Terminal (# prompt if you are logged in as the root or administrator). The Bash shell runs scripts as the interpreter. Whenever we type a command, the Bash shell will read them as a series of words (tokens). Each word is separated by a space ( ), semicolon (;), or any other command delimiter. We terminate the command by pressing the Enter key. This will insert a newline character at the end of the command. The first word is taken as a command, then consecutive words are treated as options or parameters.

The shell processes the command line as follows:

  • If applicable, the substitution of history commands
  • Converting the command line into tokens ...

Get Learning Linux Shell Scripting - 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.