Compiler and interpreter – differences in process

In any program development, the following are the two options:

  • Compilation: Using a compiler-based language, such as C, C++, Java, and other similar languages
  • Interpreter: Using interpreter-based languages, such as Bash shell scripting.

When we use a compiler-based language, we compile the complete source code and, as a result of compilation, we get a binary executable file. We then execute the binary to check the performance of our program.

On the other hand, when we develop the shell script, such as an interpreter-based program, every line of the program is input to the Bash shell. The lines of shell script are executed one by one sequentially. Even if the second line of a script has an ...

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.