Shell Scripting Tutorial for Beginners in Hindi | Episode 02
Welcome back to the Shell Scripting Series!
In Episode 2, weβll learn how to make our Bash scripts more dynamic and interactive using variables, user input, and command-line arguments.
Instead of writing scripts with fixed values, weβll learn how to accept user input, store information, perform calculations, and build practical automation scripts using Ubuntu on WSL.
π What Youβll Learn in This Episode:
β
Variables in Shell Scripting
β
Rules for Naming Variables
β
Using Variables with `echo`
β
Taking User Input with `read`
β
Building an Interactive Greeting Script
β
Special Variables in Bash (`$USER`, `$HOME`, `$?`)
β
Command-Line Arguments (`$1`, `$2`, `$#`)
β
Arithmetic Operations in Bash
β
Single Quotes vs. Double Quotes
β
Practical Project: Build a `user-info.sh` Script
π» Hands-on Practice
In this episode, weβll create a practical script that asks for your name and city, displays a personalized welcome message, and shows useful system information.
π Homework Challenge
Create a `student-info.sh` script that:
– Takes the student’s name, age, and course as input.
– Displays a formatted student summary.
– Shows the current Linux username.
π― Try solving the challenge yourself and share **DONE** in the comments when you complete it!
π Prerequisites:
– Basic Linux commands
– Ubuntu Linux or Ubuntu on WSL
– Episode 1 of the Shell Scripting Series
βΆοΈ Watch Episode 1: https://youtu.be/CaM8N5EkP7Q
π Subscribe for more tutorials on Shell Scripting, Linux, Bash, DevOps, and programming.
In the next episode, weβll explore Conditions in Bash: `if`, `else`, and `elif`.
#ShellScripting #BashScripting #Linux #Ubuntu #ProgrammingInHindi #DevOps #CodingForBeginners