Receive all updates via Facebook. Just Click the Like Button Below

User Intraction in Shell Scripts

In some cases the script needs to intract with the user and accept inputs.
In shell scripts we use the read statement to take input from the user.


The read statement in Linux Shell Scripting


The Read Statement
Used to get input (data from user) from keyboard and store (data) to variable.

read variable1, variable2,...variableN

Lets write a shell script to ask the user his name and print it. While running this script it waits for the user input.

#Script to read your name from key-board
echo "Enter your name:"
read name
echo "Hello $name, Welcome to the world of Linux!"

Save the above file as
Run it as follows:
$ chmod 755
$ ./
Enter your name: Tom
Hello Tom, Welcome to the world of Linux!


Related posts:

Advertise here

picture picture

Follow us


- Tech-Tutorials

Like us

About Techcuriosity

I am Telson, the webmaster of and through this site, I share my knowledge and curiosities in the Tech World.

What We Offer

  • What is ..?
  • How to ..?
  • Difference between ..?
  • How .. works?
  • Get in Touch
    UK : +44 77 33 890 678

    picture picture

    Our Partners

  • Website Design Dubai
  • SEO Link Exchange
  • picture