How to read the dynamic value in shell script on CentOS and RHEL 6/7 step by step guide


How to read the dynamic value  in  shell script on CentOS and RHEL 6/7  step by step guide


In this article we will learn how to read the dynamic value in shell script and execute it on CentOS and RHEL linux sytem.


Shell script is very powerful language for a system admin to execute the daily basic staff.


Variable store some information and data which will be used rest of the shell program which is predefined value but when we talk about dynamic value then we use read parameter in the shell script.

How to read dynamic value shell script on linux system

======================================================================
Now we are going to write one small shell script program to understand how to enter the dynamic value  in  shell script program and read it to put the dynamic value on the linux system  .


First we create one empty file named read.sh using the below command.

#touch read.sh

After creating empty file we enter the below line in the file.

#!/bin/bash
echo what is the name of website?
read  websitename
echo welcome to $websitename

note: we shoule use #!/bin/bash to identify this script only run in bash shell not the other shell .

How to execute the shell script program

==================================================================
To execute this program we need to execute the below command.

[root@localhost ~]# sh read.sh

After execute the above command we can find the below output..
  

Output:
what is the name of website?
techrideradmin
welcome to techrideradmin
How to read the dynamic value  in  shell script on CentOS and RHEL 6/7  step by step guide
How to read the dynamic value  in  shell script on CentOS and RHEL 6/7  step by step guide


That’s all. If this article is helpful please share it!!!!







Please Donate To Bitcoin Address: [[address]]
Donation of [[value]] BTC Received. Thank You.
[[error]]
SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment