Wednesday, April 6, 2022

Linux Shell Script Basic Examples


Comments are those lines that are only used for reference purposes but can not be executed.

Write a script to enter a Name of a Person and print that name.

#! /bin/bash

#Author Raman
# Copyright (c)  Raman
# Below is the script
echo "Enter Name"
read Person
# This will print the  name of the person
echo "Hello, $Person"

Execution of a shell Script

Let's say the file name is

Provide execute permission to

  • chmod u+x
  • ./
  • or
  • sh


Post a Comment