{"id":942,"date":"2010-09-18T07:07:06","date_gmt":"2010-09-18T07:07:06","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=942"},"modified":"2010-09-18T07:09:07","modified_gmt":"2010-09-18T07:09:07","slug":"shell-script-in-5-minutes","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2010\/09\/shell-script-in-5-minutes\/","title":{"rendered":"Shell Script in 5 minutes!"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-915\" title=\"phpmind-terminal\" src=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2010\/09\/phpmind-terminal1.png\" alt=\"\" width=\"90\" height=\"72\" \/>Shell scripts are short programs that are written in a shell programming language and interpreted by a shell process. They are extremely useful for automating tasks on Linux and other Unix-like operating systems.<\/p>\n<p>1. Here is very short tutorials to make a very basic shell scripting.<br \/>\n. open vi or any other advance editor like vim<\/p>\n<pre lang=\"html\">#!\/bin\/bash\r\nclear\r\npwd\r\necho \"Hello phpmind, world.\"\r\n<\/pre>\n<p>2.\tSave this script and give a name  for example \u201cphpmind.txt\u201d<br \/>\n3.\tphpmind will be your command.<br \/>\n4.\tTo run your command type  .\/phpmind<br \/>\n5.\tIf its says Permission denied then use chmod 755 phpmind<br \/>\n6.\tNow the script is ready to run by typing the following, again while in the same directory, and then pressing the ENTER key:<br \/>\n.\/ phpmind<\/p>\n<h4>How It Works<\/h4>\n<p>The first of the three lines tells the operating system what shell to use to interpret the script and the location (i.e., absolute pathname) of the shell. The shell is bash, which is located in the \/bin directory (as are all shells); thus the line contains \/bin\/bash. This instruction is always preceded by a pound sign and an exclamation mark in order to inform the operating system that it is providing the name and location of the shell (or other scripting language).<br \/>\nThe second line tells the shell to issue the clear command. pwd (which shows the current directory),<br \/>\nThe third line tells the shell to write the phrase Good morning, world. on the screen. It uses the echo command, which instructs the shell to repeat whatever follows it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shell scripts are short programs that are written in a shell programming language and interpreted by a shell process. They are extremely useful for automating tasks on Linux and other Unix-like operating systems. 1. Here is very short tutorials to make a very basic shell scripting. . open vi or any other advance editor like [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[32],"tags":[],"class_list":["post-942","post","type-post","status-publish","format-standard","hentry","category-shell-script"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=942"}],"version-history":[{"count":4,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions"}],"predecessor-version":[{"id":946,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/942\/revisions\/946"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}