{"id":611,"date":"2021-11-11T18:47:42","date_gmt":"2021-11-11T23:47:42","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=611"},"modified":"2024-02-08T08:46:28","modified_gmt":"2024-02-08T13:46:28","slug":"printing-bash-parameters","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/printing-bash-parameters\/","title":{"rendered":"Printing bash parameters"},"content":{"rendered":"\n<p>A parameter is an entity that stores value and is available to a program. There are many system variables available to BASH. They could be retrieved easily by prefixing a $ sign to the variable. Alternately, you can also surround them with curly braces and prefix a $ sign<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#: Title       : print parameters\n#: Version     : 1.0\n#: Description : print parameters\n#: Options     : None\n\nprintf \"%s \" \"Current Working Directory\"\necho $PWD\nprintf \"%s \" \"Home Directory\"\necho ${HOME}\nprintf \"%s\" \"Command Directories $PATH\"<\/code><\/pre>\n\n\n\n<p>Output of the script<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Current Working Directory \/home\/me\/sandbox\nHome Directory \/home\/me\nCommand Directories  \/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>PWD prints the current working directory of the shell<\/li><li>HOME store the address of the user&#8217;s home directory<\/li><li>PATH returns a colon-separated list of directories where command files are stored<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A parameter is an entity that stores value and is available to a program. There are many system variables available to BASH. They could be retrieved easily by prefixing a $ sign to the variable. Alternately, you can also surround them with curly braces and prefix a $ sign Output of the script PWD prints [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-611","post","type-post","status-publish","format-standard","hentry","category-bash"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=611"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/611\/revisions"}],"predecessor-version":[{"id":1724,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/611\/revisions\/1724"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}