{"id":27,"date":"2024-02-17T14:24:50","date_gmt":"2024-02-17T14:24:50","guid":{"rendered":"http:\/\/courses.usnh.domains\/cms\/?p=27"},"modified":"2024-02-17T23:10:12","modified_gmt":"2024-02-17T23:10:12","slug":"creating","status":"publish","type":"post","link":"https:\/\/courses.usnh.domains\/cms\/it-612\/creating\/","title":{"rendered":"Creating"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Creating a Bash Script<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s start by creating a new file with a <code>.sh<\/code> extension. As an example, we could create a file called <code>devdojo.sh<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create that file, you can use the <code>touch<\/code> command: touch devdojo.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or you can use your text editor instead: nano devdojo.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to execute\/run a bash script file with the bash shell interpreter, the first line of a script file must indicate the absolute path to the bash executable: #!\/bin\/bash<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is also called a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Shebang_(Unix)\">Shebang<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All that the shebang does is to instruct the operating system to run the script with the <code>\/bin\/bash<\/code> executable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Derived from: <a href=\"https:\/\/github.com\/bobbyiliev\/introduction-to-bash-scripting\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/bobbyiliev\/introduction-to-bash-scripting<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a Bash Script Let&#8217;s start by creating a new file with a .sh extension. As an example, we could create a file called devdojo.sh. To create that file, you can use the touch command: touch devdojo.sh Or you can use your text editor instead: nano devdojo.sh In order to execute\/run a bash script file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,3],"tags":[8],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-bash","category-it-612","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":4,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":31,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/posts\/27\/revisions\/31"}],"wp:attachment":[{"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.usnh.domains\/cms\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}