Shell script is a text File Which can contain one are more instructions and the File is Executable . Instead of using multiple commands one by one, we can write multiple commands in a single text file and Execute it. This is called Shell scripting.

 Uses of Shell Scripting:

  • Customize the working environment
  • Performing same operation on many files
  • Automating the repetitive tasks
  • Automating your daily tasks

Example  Shell Script


$ cat > hello.sh <<MY_PROGRAM

#!/bin/sh

echo ‘Hello, world’

MY_PROGRAM

$ chmod +x hello.sh

$ ./hello.sh

Hello, world


Previous     Next