Explore BASH Shell just in 5 minutes ..

Explore BASH Shell just in 5 minutes ..

Hey Guys ???? !!

Just recently I attended a fabulous workshop on ?BASH Shell Scripting? arranged by ??LinuxWorld team. During the session I was completely immersed into the contents & concepts taught fantastically by @Vimal Daga Sir. Just in few hours I learnt a lot. The session was around 8 hours. We discussed a lot on various industry requirements & how to solve them with Shell Scripting, its advantages from basics till advance level as well as some helpful linux CLI tips and tricks. For me this was one of the best engaging session in this year 2021. I would like to thank the RedHat team , the whole LW team especially Vimal Sir Preeti Ma'am for for arranging such fabulous engagements for us..

Now I would like to share some key points I have learned so far .. ????

?? Well, What is Shell?? .. Bash?? .. how they are connected ?

A shell is simply a macro processor that executes commands. The term macro processor means functionality where text and symbols are expanded to create larger expressions. A Unix shell is both a command interpreter and a programming language. 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. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories such as /bin, allowing users or groups to establish custom environments to automate their common tasks.

No alt text provided for this image

Bash is the shell, or command language interpreter, for the GNU operating system. The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of the current Unix shell sh, which appeared in the Seventh Edition Bell Labs Research version of Unix. Bash is largely compatible with sh and incorporates useful features from the Korn shell ksh and the C shell csh.

?? What is Shell Script ? And why it is important ? Where do we need it ?

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. The different operations performed by shell scripts are program execution, file manipulation and text printing.

Bash (bash) is one of many available (yet the most commonly used) Unix shells. Shell scripting is scripting in any shell, whereas Bash scripting is scripting specifically for Bash. In practice, however, "shell script" and "bash script" are often used interchangeably.

No alt text provided for this image
  • The top reason for the popularity of Bash Shell Scripting is its robust scope. It is a powerful programming method that can help you learn the command-line better, save time, and do away with tedious file management tasks.
  • While the demand continues to grow for Shell scripting talent, there remains a shortage of experienced professionals in the market. There are unlimited career advancement opportunities for developers and systems administrators who are skilled in Unix Shell Scripting.

Great !! So some other important concepts I learnt are ...

? User Defined & Pre defined Shell Variables. What is Return Code or Exit code; its importance in scripting. 

? How to update the $PATH & use of '/root/.bashrc' file, I/O Redirection, how to manage or redirect garbage value. 

? test command with multiple options (-eq, -ge, -le, -lt, -gt, -z, -d, -x, -r, -w, -x, -s, -e, -f) & their use cases.

? How to retrieve user home directory using regex & the usecase of cut command, use of delimiter & '|' symbol, tar command for backup & date command for timestamp.

? Bash Shell Scripting (hashbang, @ symbol, use of positional parameters, for & while loop, if-else condition, getting input from STDIN as well as file)

No alt text provided for this image

? Some advance use cases such as : Log Analysis over Network using Shell Scripting, word frequency count, transforming data from row oriented to column oriented. 

? How to format & retrive data according to requirement using awk command(print, $n, conditions, NR, NF, END, BEGIN) with various field separators.

? Some useful shell commands for analysis purpose such as grep, sort, uniq, tail, wc -l, cut, tr, unset, set, watch etc.

? How to identify a Shell function, advantages & how to create own shell functions.

No alt text provided for this image

? Manipulation of data using sed command by implementing regex to solve multiple use case. 

? How to check multiple conditions & decide action according to that, creating options for scripts based on Switch Case etc.

? The use of 'getopts' utility for CLI options & finally how debug the syntax errors as well as logical errors in Bash Shell scripts.

Shell is universally available (on any Unix or Linux system) where as Python is not necessarily installed. It's native support makes it essential for every IT guy to learn.

? Leaving all these behind we discussed a lot on various use cases where we need these shell scripting skills as well as Linux shell tips & tricks.

So What Are Waiting For ? Go and Start your Scripting Journey .

- - - - > That's all from my side, hope you have a fantastic read < - - - -

Thank You Guys :)
??

 









要查看或添加评论,请登录

Krushna Prasad Sahoo的更多文章

社区洞察

其他会员也浏览了