Shell-Scripting: An overview

Shell-Scripting: An overview
Techiio-author
Written by Debarghya DasDecember 3, 2021
7 min read
Shell-scripting
3 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 3 VIEWS SHARE
Techiio-author
Debarghya Das

Junior Front-End Developer

This article explains to you the overview of Shell-Scripting and its advantages and disadvantages.

About Shell-Scripting

A shell script is a list of commands in a computer program that is run by the Unix shell which is a command-line interpreter. A shell script usually has comments that describe the steps. The different operations performed by shell scripts are program execution, file manipulation, and text printing. A wrapper is also a kind of shell script that creates the program environment, runs the program, etc.

blogpost

Types of Shells

There are two major types of shells in Unix. These are:

  • Bourne Shell: This is the default shell for version 7 Unix. The character $ is the default prompt for the bourne shell. The different subcategories in this shell are Korn shell, Bourne Again shell, POSIX shell etc.
  • C Shell: This is a Unix shell and a command processor that is run in a text window. The character % is the default prompt for the C shell. File commands can also be read easily by the C shell, which is known as a script.

Why Shell Scripting?

Shell scripting provides us with proper command and a platform to execute the commands with the desired input and generate the output needed. It works as a mediator to talk with the system kernel and various OS components.

We can simply think it as of a path or a way to a door that connects with the room we need for. So basically having the knowledge for shell scripting will ease the way we are willing to execute our commands further. We can start or stop any application together by just writing a simple script or we can initialize anything needed at the boot time with the help of shell scripting. It reduces the effort of a user by writing a series of commands at once.

Capabilities of Shell Script

The different capabilities of the shell script are −

  • Batch jobs: Several commands that would be entered manually in a command line interface can be executed automatically using a shell script. This can be done without the user needing to trigger each command separately.
  • Programming: There are many features in modern shell scripts that are only found in sophisticated programming languages such as arrays, variables, comments etc. Many complicated applications can be written in shell scripts using these features. But there is a problem i.e. shell script languages don’t support classes, threading etc.
  • Generalisation: It is much more flexible to use loops, variables etc for multiple tasks in shell script. An example of this is a Unix shell script known as bash, which converts jpg images to png images.
  • Shortcuts: There is a shortcut provided by a shell script for a system command where command options, environment settings or post processing apply. This still allows the shortcut script to act as a Unix command.

Applications of Shell Scripting

Shell Scripts are used for many purposes some of them are like:-

  • Execution of any batch job.
  • Execution of any run on startup.
  • Running a program.
  • Linking of directories and files over.
  • Routine task execution.
  • Monitoring of Jobs.
  • Kernel level communication.
  • Root dir operations.

Advantages and Disadvantages of Shell-Scripting

Advantages of Shell Script:

Some of the advantages of shell script are −

  • The commands and syntax of the shell script are the same as that entered at the command line. Because of this, there is no need to switch to a completely different syntax.
  • It is much faster to write a code in shell script than in other programming languages. This also means that the program is easier to create and files required can be selected easily.
  • Shell script can also be used to provide linkage for already existing programs.
  • Shell scripting can be used by users that are not experts to modify and tailor the behaviour of their programs according to their requirements.

Disadvantages of Shell Script:

Some of the disadvantages of shell script are −

  • There may be errors in shell scripting that prove to be quite costly.
  • The programs in shell script are quite slow while executing and a new process is required for every shell command executed.
  • Different platforms in shell scripting may also have compatibility problems.

Conclusion

For the reader, you ought to have a piece of fundamental information on part and Linux and Unix. The most effective method to execute a rationale and ordinary factors esteem utilized would be an additional benefit.

Shell scripting
Linux
Unix
3 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 3 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-author
Debarghya Das
Junior Front-End Developer
Techiio-followerTechiio-followerTechiio-followerTechiio-followerTechiio-follower
+3 more
75 Blog Posts
227 Discussion Threads
Trending Technologies
15
Software40
DevOps46
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance