First example in linux shell scripting

You should remember below things while writing the scripts.
  • Every script should being with “#!/bin/bash”
  • Comments can be added by prefixing the line with #
We are going to write a simple program in our first script. Write below lines of code in a file and name it as


echo $x

Before you execute above command, ensure that you modify the permission of the file so that you can execute it.
chmod +x

To execute this program, just go to the shell prompt and type ./ This should generate below output.

Web development and Automation testing

solutions delivered!!