.sh command in Ubuntu


The command to run an .sh file is

   sh file1.sh

An .sh file is written this way:

   #!/bin/sh

   echo "my message" > file1.txt

The above codes create a file file1.txt with the text my message on it.

The .sh file can also be run this way too:

Chmod is a change mode command where x represent execute. chmod command is used for various purpose. In our case we are simply trying to set an executable permission to the file

  chmod +x file1.sh

Then give this code to run the file

   ./file1.sh

In the above code the character dot . represents the current directory.

Comments

Post a Comment

Popular posts from this blog

dual boot ubuntu and windows 8

Application Software in Ubuntu

Change the Size of an Image for the screen