Insights to Linux Shell Script

Saptarsiroy
3 min readApr 27, 2021

--

~ A workshop at the need of the hour

Shell Scripting

At the foremost position, what exactly is a Shell Script?

A shell script is a computer program designed to be run by the Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. It is a program to write a series of commands for the shell to execute.

Bash scripts can be used for various purposes, such as executing a shell command, running multiple commands together, customizing administrative tasks, performing task automation etc. So knowledge of bash programming basics is important for every Linux user.

The various types of Shell available to Linux base are:-

  • Bourne shell (sh)
  • Korn shell (ksh)
  • Bourne Again Shell (bash)
  • POSIX shell (sh)

But why should we learn a primitive concept of shell scripting?

The biggest advantage of writing a shell script is that the commands and syntax are exactly the same as those directly entered at the command-line. Often, writing a shell script is much quicker than writing the equivalent code in other programming languages. A shell script can be used to provide a sequencing and decision-making linkage around existing programs, and for moderately sized scripts the absence of a compilation step is an advantage. Interpretive running (like the Python interpreter) makes it easy to write debugging code into a script and re-run it to detect and fix bugs.

Shell Scripting — The 2 Days Long Workshop by LinuxWorld Informatics Pvt. Ltd.

As a quick guide to effective learning of the detailed concepts of Shell Scripting, LinuxWorld offered us the opportunity to experience an 8 hours long Workshop on the same, panned for two days — 24th and 25th April. The mentor was none other than the World Record Holder Mr. Vimal Daga Sir, and co-ordinated by the proficient Mrs. Preeti Daga Ma’am.

Key notables of the workshop are as follows:-

→ Introduction to operating system, interfaces and OS shell.

→ Use of bash shell and scripting on it

→ Working with variables, inputs, and exit code in shell script.

→ An insight to hashbang/shebang at the start of a shell script.

→ Looping in shell script (for loop and while loop)

→ I/O redirection in shell script

→ Working with relevant shell commands like ‘awk’, ‘watch’, ‘sed’, ‘date’(filters)

→ Hands-on practical:- i) User creation and management using shell script
ii) Log Management using shell script

The workshop was quite contentive and wholesome. I am extremely grateful to LinuxWorld for brimming us with such informative content within a limited period of time!

HAVE A GOOD DAY EVERYONE! :)

--

--