Basic Linux
@ Animesh Roy | Friday, Mar 26, 2021 | 1 minutes read | Update at Friday, Mar 26, 2021

Overview

Class Practical for Linux Basic Scripting

Hello {Name}

#!/bin/bash 
echo "Hello, $1" 

Output

bash hello.sh Mentor 
Hello Mentor 

Age Check

#!/bin/bash

#user-input
echo -n "Enter Your Age: "
read VAR 

#function
if [[ $VAR -gt 21 ]]
then
	echo "You're Adult"
else
	echo "Nope!"
fi

OutPut

bash age.sh 19 
Nope!

© 2010 - 2024 Classroom

Reading Stuffs

Social Links

YOU CAN REUSE MY CONTENT