![]() ![]() The output is like below where the user has the execute permission which is depicted with the x letter.Īlternatively if the shell script if is another directory then the current working directory we can specify the full or absolute path to execute it. We can check if the shell script file is executable with the ls command like below. In the following example we make the systeminfo.sh shell script file executeable for the current user. It can be made executable by the shell by using the chmod command. The shell file is just a file with some text by default. The most command way to execute or run a shell script is making it executable and then call. hostnamectlĮcho "This is a shell script." Make Shell Script Executable and Run In this example, we create the shell script named systeminfo.sh. ![]() Just create a text file with the *.sh extension. Create Shell Script or Script Fileīefore starting to run a shell script file we create a script file. In this tutorial, we will learn how to run shell script files in different ways. The shell scripts have the *.sh extension for the Bash or Sh. The shell script is used to run single or more commands by just calling the shell script file without writing commands again and again. These commands can be stored in a file which is called a shell script. Commands run on bash in order to complete tasks or jobs. The Bash and Bash Shell is the main management component for the Linux systems.
0 Comments
Leave a Reply. |