{"id":14444,"date":"2023-07-25T06:28:02","date_gmt":"2023-07-25T06:28:02","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=14444"},"modified":"2023-12-06T06:58:52","modified_gmt":"2023-12-06T06:58:52","slug":"executing-bash-script","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/","title":{"rendered":"Executing Bash script"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>Executing <\/strong>a <strong>Bash script<\/strong> means running or launching the script in a<strong> Bash shell <\/strong>or<strong> terminal<\/strong>. Executing a Bash script involves having the<strong> Bash interpreter <\/strong>read and execute the commands and instructions written in the script file. In this writing, I will discuss the basics you need to know about executing a bash script.<\/p>\n<div class=\"su-youtube su-u-responsive-media-yes\"><iframe width=\"600\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/FTwUQX72sGA?\" frameborder=\"0\" allowfullscreen allow=\"autoplay; encrypted-media; picture-in-picture\" title=\"\"><\/iframe><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#Why_Executing_a_Bash_Script_is_Necessary\" >Why Executing a Bash Script is Necessary?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#Necessary_Steps_for_Executing_a_Bash_Script\" >Necessary Steps for Executing a Bash Script<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#A_Add_Executive_Permission\" >A. Add Executive Permission<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#B_Run_the_Bash_Script_File\" >B. Run the Bash Script File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#C_Source_the_Bash_Script\" >C. Source the Bash Script<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#Run_Commands_in_parallel\" >Run Commands in parallel<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#Ways_to_Run_Bash_Commands_in_Parallel\" >Ways to Run Bash Commands in Parallel<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#1_Ampersand_%E2%80%98_Sign\" >1. Ampersand \u2018&amp;\u2019 Sign<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#2_The_%E2%80%9Cwait%E2%80%9D_Command_With_the_Ampersand_%E2%80%98_Sign\" >2. The &#8220;wait&#8221; Command With the Ampersand \u2018&amp;\u2019 Sign<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#3_The_%E2%80%9Cxargs%E2%80%9D_Command\" >3. The &#8220;xargs&#8221; Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#4_GNU_Parallel\" >4. GNU Parallel<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#People_Also_Ask\" >People Also Ask<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Why_Executing_a_Bash_Script_is_Necessary\"><\/span>Why Executing a Bash Script is Necessary?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Enabling the execution of <strong>Bash <\/strong>script files is a necessary step for running your<strong> Bash<\/strong> programs effectively as they <strong>aren\u2019t executable<\/strong> by default. If you don\u2019t make your file executable, you won\u2019t be able to run it directly as a program in <strong>Bash<\/strong>. As a result, the commands written inside the script will also not be executed to perform specified tasks.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Necessary_Steps_for_Executing_a_Bash_Script\"><\/span>Necessary Steps for Executing a Bash Script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">After you have written a<strong> Bash script<\/strong> file and saved the file with a proper name in a desired location, next you need to execute the script, right? Read out the following stepwise tasks you need to do for <strong>executing a Bash script<\/strong>:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"A_Add_Executive_Permission\"><\/span>A. Add Executive Permission<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">By default, when you create a file in <strong>Bash<\/strong>, it <strong>does not<\/strong> have the <strong>executable permission <\/strong>set. So as the initial step to execute a script or program, you must make it executable by adding <strong>executable permission<\/strong>. Otherwise, attempting to execute a <strong>non-executable<\/strong> file will result in a <strong>\u201cpermission denied\u201d<\/strong> error.<\/p>\n<p style=\"text-align: justify;\">Now, the command that is used to add any kind of permissions to any files is the <a href=\"https:\/\/linuxsimply.com\/chmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>chmod command<\/strong><\/a>, &amp; that is no exception for the bash scripts too. And to add the executable permission for a user for any bash script file, use the <strong>general<\/strong> <strong>command syntax:<\/strong><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">chmod u+x script.sh<\/code><\/pre>\n<p style=\"text-align: justify;\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-14453\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/1.-Add-executive-permission.png\" alt=\"Adding executive permission\" width=\"700\" height=\"146\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/1.-Add-executive-permission.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/1.-Add-executive-permission-300x63.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/1.-Add-executive-permission-767x160.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>In the image you can see, I am adding executive permission to my <strong>Bash script file<\/strong> named <strong>\u2018test.sh\u2019<\/strong>.<\/p>\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">To learn more about adding executing permission to a Bash script, please go through \u2018<a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/make-file-executable\/\" target=\"_blank\" rel=\"noopener\"><strong>How to Make a File Executable in Bash<\/strong><\/a>\u2019. <\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"B_Run_the_Bash_Script_File\"><\/span>B. Run the Bash Script File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Running an <strong>executable<\/strong> <strong>Bash<\/strong> <strong>script file<\/strong> is the final process of getting the desired work done through <strong>Bash <\/strong>scripts. And for that, <strong>Bash<\/strong> provides various methods to run executable scripts, offering convenience to users. You can run a Bash script by using both <a href=\"https:\/\/linuxsimply.com\/what-is-gui\/\" target=\"_blank\" rel=\"noopener\"><strong>GUI<\/strong><\/a> &amp; <a href=\"https:\/\/linuxsimply.com\/cli-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>CLI<\/strong><\/a>.<\/p>\n<p style=\"text-align: justify;\">With the <strong>graphical interface<\/strong>, you can run an executable script file just by right-clicking on it &amp; selecting <strong>\u2018Run as a Program\u2019<\/strong> from the context menu.<\/p>\n<p style=\"text-align: justify;\">For the <strong>command line interface<\/strong>, you can use several commands such as <strong>sh<\/strong>, and <strong>bash<\/strong> to execute a script. Moreover, you can also run a script just by specifying its path location. For example, check out the following image where I am running a Bash script named <strong>&#8216;test.sh&#8217;<\/strong> just by specifying its <strong>location path<\/strong> (<strong>\u2018.\/\u2019 <\/strong>is indicating the script is in the<strong> current directory<\/strong>).<img decoding=\"async\" class=\"aligncenter size-full wp-image-14454\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/2.-Run-the-script.png\" alt=\"Executing a bash script \" width=\"700\" height=\"177\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/2.-Run-the-script.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/2.-Run-the-script-300x76.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/2.-Run-the-script-767x194.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/> The <strong>script (test.sh)<\/strong> is executed successfully &amp; printing the output.<\/p>\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">Learn each of the methods, to run a bash script from \u2018<a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/run-a-script\/\" target=\"_blank\" rel=\"noopener\"><strong>How to Run a Bash Script<\/strong><\/a>\u2019.<\/div><\/div>\n<h3><span class=\"ez-toc-section\" id=\"C_Source_the_Bash_Script\"><\/span>C. Source the Bash Script<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In <strong>Bash <\/strong>scripting, sourcing a script allows you to run the commands within the script in the current shell session, rather than launching a new subshell. And this entire process is much more helpful when you need to load environment variables, define functions, or execute commands that should affect the current shell session.<\/p>\n<p style=\"text-align: justify;\">You can source a Bash script using the source command or the dot command. The <strong>dot command<\/strong> is basically a shorter approach for the <strong>source command<\/strong>. In other words, <strong>a symbol (.) <\/strong>that represents the <strong>source<\/strong> command. Use the command syntax <strong>\u2018. filename.sh\u2019<\/strong> while using the dot command or <strong>\u2018source filename.sh\u2019<\/strong> for the source command to source a file.<\/p>\n<p style=\"text-align: justify;\">To source a simple script (<strong>test.sh<\/strong>) using the <strong>source command<\/strong> or <strong>dot command<\/strong> just type the following command in your terminal:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">source test.sh<\/code><\/pre>\n<p><span style=\"color: #800080;\"><strong>OR,<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">. test.sh<\/code><\/pre>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14455\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/3.-Run-a-script-using-source.png\" alt=\"Executing a bash script using the source command\" width=\"700\" height=\"162\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/3.-Run-a-script-using-source.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/3.-Run-a-script-using-source-300x69.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/3.-Run-a-script-using-source-765x177.png 765w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>As you can see, the script is sourced successfully &amp; printing the output message (<strong>Hello!<\/strong>) of the script. Same way you can also use the <strong>dot operator<\/strong> in place of the <strong>source command<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14456\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/4.-Run-a-script-using-dot.png\" alt=\"Executing a bash script using the dot command\" width=\"700\" height=\"183\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/4.-Run-a-script-using-dot.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/4.-Run-a-script-using-dot-300x78.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/4.-Run-a-script-using-dot-765x200.png 765w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">From the output image you can see, the script is sourced successfully with the <strong>dot command<\/strong> &amp; printing the output message (<strong>Hello!<\/strong>).<\/p>\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\">Learn more about sourcing a Bash script using the dot command from \u201c<a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/dot-command\/\" target=\"_blank\" rel=\"noopener\"><strong>A Complete Overview of Bash Dot Command<\/strong><\/a>\u201d &amp; using the source command from \u201c<a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/source\/\" target=\"_blank\" rel=\"noopener\"><strong>What are the Usages of Bash Source<\/strong><\/a>\u201d.<\/div><\/div>\n<p style=\"text-align: justify;\">So far from this article, you know how to make a <strong>bash script file executable<\/strong> &amp;<strong> run<\/strong> that script as the final step of executing a script. Now, check the following <strong>application of Bash script <\/strong>where I will talk about running several commands in parallel:<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Run_Commands_in_parallel\"><\/span>Run Commands in parallel<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">Running <strong>Bash commands<\/strong> in parallel is a technique or method of executing multiple commands simultaneously in a <strong>Bash shell environment<\/strong>. This method helps in reducing overall execution time. Moreover, you can process a large number of files and even a complex command that takes a long time to execute. Along with that, it also improves the performance of a Bash script that is running on a single <strong>CPU<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Ways_to_Run_Bash_Commands_in_Parallel\"><\/span>Ways to Run Bash Commands in Parallel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Read out the following described ways, through which you can run multiple <strong>Bash commands <\/strong>of a Bash script in <strong>parallel<\/strong> while executing the script.<\/p>\n<h4 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"1_Ampersand_%E2%80%98_Sign\"><\/span>1. Ampersand \u2018&amp;\u2019 Sign<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">As a simple approach, use the inherent <strong>Bash ampersand (&amp;)<\/strong> operator to run commands in parallel. It allows to execute a command asynchronously, enabling the shell to proceed to the next command without waiting for the current one to finish.<\/p>\n<p><span style=\"color: #800080;\"><strong>Basic Syntax &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">command1&amp;\ncommand2&amp;<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"2_The_%E2%80%9Cwait%E2%80%9D_Command_With_the_Ampersand_%E2%80%98_Sign\"><\/span>2. The &#8220;wait&#8221; Command With the Ampersand \u2018&amp;\u2019 Sign<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">The <strong>wait command<\/strong> waits for all child processes to exit. So using the<strong> wait command<\/strong> with the \u2018&amp;\u2019 operator we can run batches of operations.<\/p>\n<p><span style=\"color: #800080;\"><strong>Basic Syntax &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">command1&amp;\ncommand2&amp;\n\nwait<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"3_The_%E2%80%9Cxargs%E2%80%9D_Command\"><\/span>3. The &#8220;xargs&#8221; Command<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/xargs-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>xargs command<\/strong><\/a> can be used to execute commands in parallel by combining it with the <strong>\u2018-p\u2019 option<\/strong>. This option specifies the maximum number of parallel processes to run.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"4_GNU_Parallel\"><\/span>4. GNU Parallel<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\"><strong>GNU Parallel<\/strong> is a powerful tool that allows you to run commands in parallel. By default, the parallel is not included but you can install <strong>GNU Parallel <\/strong>on your system directly from the command line.<\/p>\n<p><span style=\"color: #800080;\"><strong>Basic Syntax &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">parallel ::: prog1 prog2<\/code><\/pre>\n<p style=\"text-align: justify;\">Here,<strong> \u2018:::\u2019 <\/strong>is a <strong>special syntax<\/strong> that tells the command to iterate over a list of<strong> arguments<\/strong>.<\/p>\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#333333;\"> To learn each of the methods of running bash commands in parallel with practical examples, please go through the article \u2018<a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/run-commands-in-parallel\/\" target=\"_blank\" rel=\"noopener\"><strong>How to Run Bash Commands in Parallel<\/strong><\/a>\u2019.<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To sum up, <strong>executing Bash scripts<\/strong> lets you automate tasks, making things easier and faster. In this writing, I explained the importance &amp; necessary steps of making a Bash script file executable. Hope this article helps you in understanding the entire process.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><div class=\"su-accordion su-u-trim\">\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What is script execution?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Script execution refers to the process of running a script, which is a series of commands and instructions written in a programming or scripting language. <\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What are the steps to execute a shell script?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">To execute a shell script, first, create the shell script &amp; save the file with the<strong> .sh <\/strong>extension. After that, set the execute permission for the script. Finally, run the Bash script &amp; simply view output or automate scripted tasks. <\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How to execute a script?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> To execute a script, you have to add <strong>executable permission<\/strong> to the script. After that, you can run the Bash script &amp; simply view output or automate scripted tasks. <\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How do I run a bash script step by step?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> To run a bash script step by step, first, create the shell script &amp; save the file with the <strong>.sh (say, test.sh) <\/strong>extension. After that, set the execute permission for the script using the chmod command (<strong>chmod u+x test.sh<\/strong>). Finally, run the Bash script (<strong>.\/test.sh<\/strong>) from your terminal &amp; simply view output or automate scripted tasks. <\/div><\/div>\n<p style=\"text-align: justify;\"><\/div>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/make-file-executable\/\" target=\"_blank\" rel=\"noopener\">How to make a File Executable in Bash [2 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/dot-command\/\" target=\"_blank\" rel=\"noopener\">A Complete Overview of Bash Dot Command [With 2 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/source\/\" target=\"_blank\" rel=\"noopener\">What are the Usages of Bash Source [3 Practical Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/run-a-script\/\" target=\"_blank\" rel=\"noopener\">How to Run a Bash Script [2 Methods with Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/run-commands-in-parallel\/\" target=\"_blank\" rel=\"noopener\">How to Run Bash Commands in Parallel [4 Ways with Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to\u00a0<span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Scripting Basics&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:16768,&quot;10&quot;:1,&quot;11&quot;:4,&quot;17&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Basics<\/a> <\/span>| <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;14444&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (1 vote)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Executing Bash script&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 142.5px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            5\/5 - (1 vote)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Executing a Bash script means running or launching the script in a Bash shell or terminal. Executing a Bash script &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Executing Bash script\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#more-14444\" aria-label=\"Read more about Executing Bash script\">Read more<\/a><\/p>\n","protected":false},"author":314897,"featured_media":14457,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[125],"class_list":["post-14444","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-bash-scripting-basics","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Executing Bash script<\/title>\n<meta name=\"description\" content=\"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren&#039;t executable by default.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Executing Bash script\" \/>\n<meta property=\"og:description\" content=\"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren&#039;t executable by default.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/moniramunny05\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T06:28:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T06:58:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Monira Akter Munny\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monira Akter Munny\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/\"},\"author\":{\"name\":\"Monira Akter Munny\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\"},\"headline\":\"Executing Bash script\",\"datePublished\":\"2023-07-25T06:28:02+00:00\",\"dateModified\":\"2023-12-06T06:58:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/\"},\"wordCount\":1425,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/executing-bash-script.png\",\"keywords\":[\"bash scripting basics\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/\",\"name\":\"Executing Bash script\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/executing-bash-script.png\",\"datePublished\":\"2023-07-25T06:28:02+00:00\",\"dateModified\":\"2023-12-06T06:58:52+00:00\",\"description\":\"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren't executable by default.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/executing-bash-script.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/executing-bash-script.png\",\"width\":400,\"height\":400,\"caption\":\"Executing bash script\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/executing\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bash Scripting Basics\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/basics\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Executing Bash script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\",\"name\":\"Monira Akter Munny\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"caption\":\"Monira Akter Munny\"},\"description\":\"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/moniramunny05\",\"https:\\\/\\\/www.instagram.com\\\/monira_munny\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/monira-akter-munny-a76742113\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/munny\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Executing Bash script","description":"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren't executable by default.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/","og_locale":"en_US","og_type":"article","og_title":"Executing Bash script","og_description":"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren't executable by default.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/moniramunny05","article_published_time":"2023-07-25T06:28:02+00:00","article_modified_time":"2023-12-06T06:58:52+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png","type":"image\/png"}],"author":"Monira Akter Munny","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monira Akter Munny","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/"},"author":{"name":"Monira Akter Munny","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e"},"headline":"Executing Bash script","datePublished":"2023-07-25T06:28:02+00:00","dateModified":"2023-12-06T06:58:52+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/"},"wordCount":1425,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png","keywords":["bash scripting basics"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/","name":"Executing Bash script","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png","datePublished":"2023-07-25T06:28:02+00:00","dateModified":"2023-12-06T06:58:52+00:00","description":"Executing a Bash script is necessary whether for automating tasks or executing complex commands as they aren't executable by default.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/07\/executing-bash-script.png","width":400,"height":400,"caption":"Executing bash script"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Bash Scripting Basics","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/"},{"@type":"ListItem","position":4,"name":"Executing Bash script"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e","name":"Monira Akter Munny","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","caption":"Monira Akter Munny"},"description":"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio","sameAs":["https:\/\/www.facebook.com\/moniramunny05","https:\/\/www.instagram.com\/monira_munny\/","https:\/\/www.linkedin.com\/in\/monira-akter-munny-a76742113\/"],"url":"https:\/\/linuxsimply.com\/author\/munny\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/14444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314897"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=14444"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/14444\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/14457"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=14444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=14444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=14444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}