![]() ![]() ![]() In order to verify if a shell interpreter is installed on your system, use the “ which” command and specify the interpreter you are looking for. “ Bash” is the shell interpreter installed by default, but you may want to execute your script using other interpreters. This is the output from your script! Execute Bash script using sh, zsh, dashĭepending on your distribution, you may have other shell utilities installed on your system. In order to execute it using the “bash” utility, you would run the following command $ bash script $ bash Īlternatively, you can use “sh” if your distribution has the sh utility installed.Īs an example, let’s say that you want to run a Bash script named “script”. In order to run a Bash script on your system, you have to use the “bash” command and specify the script name that you want to execute, with optional arguments. # Relative pathĪwesome, you learnt how you can easily run a Bash script on your system. # Absolute pathĪlternatively, you can specify the relative path to the Bash script that you want to run. In order to execute this script, you can specify the full path to the script that you want to run. Īs an example, let’s say that you have a Bash script located in your home directory. In order to run a Bash script on Linux, simply specify the full path to the script and provide arguments that may needed in order to run your Bash script. ![]() Now that your file is executable, let’s see how you can run your Bash script easily. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |