What is shell script?

by Daniel Pham
Published: Updated:
This entry is part 1 of 6 in the series Writing your first script

In this article, I will introduce you to the shell script. If you have determined that you will be working with a Linux system, make sure you work with the command line very well. Linux operating systems provide users with a tool to work with operating systems called shell. So what is a shell? And what is a shell script?

What is a shell?

In Linux operating systems, there is an especially important part called kernel. It helps to communicate between operating systems, users, applications with hardware. Every operation, every program that a user executes must pass through the kernel.

In this article, we will not go to find out what the kernel is. Through the image below, you can see where the kernel is located in a system.

What is shell script?
Linux operating system architecture. Source: internet.

Back to the question in this section, What is a shell? As you can see, the kernel manages all programs, resources. But you can not edit directly on the kernel (unless you are an operating system developer), so you need an intermediate program, shell is born.

Shell is an interactive interface between the user and the kernel. Shell programs will interpreter the user’s commands into system commands and execute commands.

Of course, Linux desktop operating systems now have graphical user interfaces. But we are talking here of people who work with the Linux command line system: linux system administrators, linux system programmers … And to work with the shell, we need the terminal window. All current linux OSs are built-in.

What is a shell script?

User commands can be received through two ways: interacting through terminal windows or through scripts.

So, the shell script is a script file that contains user commands written sequentially from top to bottom. Shell programs will read the script from top to bottom and interpret it (not compiled it) through the kernel.

What is shell script?
An example of a shell script.

Some common shell types

In the Unix/Linux world there are many shell …

Shell Bourne (sh)

As Steven Bourne writes, it’s the primitive shell that is present on most Unix/Linux systems. It is very useful for shell programming but it does not handle user interaction like other shell.

Bourne Again Shell (bash)

This is an extension of sh, which inherits what sh already has and what it does not have. It has a very powerful and flexible programming interface. Along with the easy to use command line interface. This is the shell that is installed and set by default on Linux systems.

Shell C (csh)

Compatible with the user. It is very powerful support for the programmer C and with automatic completion of the command line.

Shell Korn

This is a great shell, it combines the superiority of sh and csh.

zsh

This is the most powerful shell in recent times. It supports a lot of powerful features, but the installation is very simple.

Conclusion

I know that this article only presents a simple and brief shell script. What I want to convey here is the first look at the shell, what it is and what it does. Once you have grasped its position in the system and are familiar with it, you will not be hard to understand more about it.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series NavigationNext part: What is bash script? »»

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.