DEV Community

Cover image for What are command-interpreter programs?
HeaderOnTop
HeaderOnTop

Posted on

What are command-interpreter programs?

Bash can be a useful program for many developers. However, I'm sure many of them using Bash don't know how it works and the differences between Bash, Shell, and the Terminal.

Firstly, we have to understand what we are studying and why. I'm writing this article to share with you what I've learned from the project Minishell at School 42. If you don't know, this project is the first group project in the course at this school.

The goal is to create our Bash program. The concept is easy to understand, but the project itself is complicated. The complicated part is the research we have to make to understand it.

The difference between shell, bash and the terminal

Before being the program we know, the terminal was an electronic device for processing data. And so, its goal was to make computer data understandable for humans by using a command interpreter program called a shell as explained in The GNU Bash Reference Manual:

"As a command interpreter, the shell provides the user interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined."

Ramey, C., & Fox, B. (2019, May 12). The GNU Bash Reference Manual, Edition 5.0. Retrieved May 14, 2020, from https://www.gnu.org/software/bash/manual/bash.html

Schema

The idea of this program is to edit and display the computer's data depending on the user's demand. Then, it translates this data in a language the user can understand.

The problem is that human language is too complicated for a computer. So, the user has to use a programming language, which is a simplified version of both human and computer binary language.

As shell is the general term used to define commands interpreter programs, Bash is the name given to the one created for the GNU operating systems (Read More).

How does it look like in today’s computers?

The most significant change from today’s computers is that we have managed to make everything smaller. And so, we found it better to put everything together.

Schema

In a modern computer, the terminal is both the window and the program that makes it possible to run a shell. The shell, on its side, becomes just a program. And so, creating a shell became even more accessible for programmers.

However, if you already used a shell, you might have notice two different shell programs on your computer. Most of the time, when you see a shell script, the first line starts with #!/bin/.

That means the script should execute in the shell specified. So, we understand that this shell program is in the /bin directory of the computer.

Schema

But something doesn't make sense. If Bash is the name given to the shell, what is SH then? Depending on the operating system you are using, SH can be something different. In most of them, it refers to the default shell of the system. For example, on macOS, SH is a symlink to Bash.

Schema

As you can guess, SH is not just launching Bash, because in this case, it will be useless. SH is running Bash in a mod called POSIX, which makes it following specific standards to keep the compatibility with other operating systems.

Top comments (0)