{"id":3156,"date":"2023-06-28T13:08:49","date_gmt":"2023-06-28T13:08:49","guid":{"rendered":"https:\/\/www.copahost.com\/blog\/?p=3156"},"modified":"2023-07-06T03:01:24","modified_gmt":"2023-07-06T03:01:24","slug":"bash-commenting-3-ways-to-use-comments","status":"publish","type":"post","link":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/","title":{"rendered":"Bash commenting: 3 ways to use comments"},"content":{"rendered":"\n<p>Bash commenting is an important aspect while developing software, as<strong> comments provide information and explanations about scripts<\/strong>. These explanations and information not only enable the coder to easily understand their own commands in the future, but also inform other developers about the code. So, in this article, we will explore the use of comments in bash scripts by covering different styles of comments and best practices. <strong>In other words, a bash comment won&#8217;t be executed. It&#8217;s only meant for documenting.<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 ez-toc-wrap-center 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\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#Bash_Commenting_Styles\" title=\"Bash Commenting Styles\">Bash Commenting Styles<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#Single-Line_bash_commenting\" title=\"Single-Line bash commenting\">Single-Line bash commenting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#Multi-Line_Comments\" title=\"Multi-Line Comments\">Multi-Line Comments<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#An_Exception_Shebang\" title=\"An Exception: Shebang\">An Exception: Shebang<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#Best_Practises_For_Bash_Commenting\" title=\"Best Practises For Bash Commenting\">Best Practises For Bash Commenting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#FAQ\" title=\"FAQ\">FAQ<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Bash_Commenting_Styles\"><\/span>Bash Commenting Styles<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are two primary styles of comments: <strong>single-line<\/strong> comments and <strong>multi-line<\/strong> comments<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Single-Line_bash_commenting\"><\/span>Single-Line bash commenting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Single-line comments are used to add comments to a particular line of code. In Bash, the &#8220;#&#8221; character denotes the beginning of a single-line comment. Anything after the &#8220;#&#8221; character on the same line is considered a comment and is not executed by the shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># This is a single-line comment.\necho \"Hello, World!\"  # This is another comment.<\/code><\/pre>\n\n\n\n<p>Here is how the code above looks like in a bash file opened with the <a href=\"https:\/\/www.copahost.com\/blog\/install-nano\/\">Nano<\/a> command line editor:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/bash-single-line-comments-1024x725.png\" alt=\"Single-line comment in bash\" class=\"wp-image-3163\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/bash-single-line-comments-1024x725.png 1024w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/bash-single-line-comments-300x212.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/bash-single-line-comments-768x544.png 768w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/bash-single-line-comments.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Multi-Line_Comments\"><\/span>Multi-Line Comments<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Bash does not have built-in support for multi-line comments like some other programming languages. However, you can simulate multi-line comments by using multiple single-line comments.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># This is a multi-line comment\n# and provides detailed information\n# about the script or code block.\n\necho \"Hello, world!\"\n\n# This is another comment\n# explaining a specific part\n# of the code.<\/code><\/pre>\n\n\n\n<p>Here is how it looks in the nano editor:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/multi-line-comments-in-bash-1024x725.png\" alt=\"Multi-line comment in bash\" class=\"wp-image-3164\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/multi-line-comments-in-bash-1024x725.png 1024w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/multi-line-comments-in-bash-300x212.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/multi-line-comments-in-bash-768x544.png 768w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/multi-line-comments-in-bash.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The other way is to use the null command (<code>:<\/code>)  along with the <a href=\"https:\/\/linuxize.com\/post\/bash-heredoc\/\">heredoc notation<\/a>. Heredoc is often used when you need to pass a block of text or code as an input to a command. In addition to this, it can also be used to create multi-line comments.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>: &lt;&lt;COMMENT\nThis is a multiline block comment.\nYou can write multiple lines here.\nCOMMENT<\/code><\/pre>\n\n\n\n<p>If you paste the above code into an editor,  it would look like the image shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/heredoc-multi-line-comment-1024x725.png\" alt=\"Heredoc comment in bash\" class=\"wp-image-3166\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/heredoc-multi-line-comment-1024x725.png 1024w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/heredoc-multi-line-comment-300x212.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/heredoc-multi-line-comment-768x544.png 768w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/heredoc-multi-line-comment.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Note that this is a trick to create Multi-line comments, so it is recommended to use Single-Line Comments to create multi-line comments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"An_Exception_Shebang\"><\/span>An Exception: Shebang <span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In Bash scripting, there is a special syntax known as shebang or hashbang. It is very similar to a single-line comment as it is denoted by the combination of a hash symbol (#) followed by an exclamation mark (!). However, it is not a comment and is used to inform the system about the interpreter to be used for executing the script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\necho \"Hello, world!\" <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash-1024x725.png\" alt=\"Shebang in bash\" class=\"wp-image-3168\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash-1024x725.png 1024w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash-300x212.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash-768x544.png 768w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Best_Practises_For_Bash_Commenting\"><\/span>Best Practises For Bash Commenting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Writing comments in bash scripts is essential. At this point, there are some guidelines to consider when adding comments to your Bash scripts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Be concise and clear<\/strong>: Write comments that are short but clearly convey the intended message. Avoid unnecessary detail.<\/li>\n\n\n\n<li><strong>Include a header comment<\/strong>: Begin your script with a header comment. It can provide an overview of the script&#8217;s purpose, author, date and more<\/li>\n\n\n\n<li><strong>Avoid unnecessary comments<\/strong>: Do not specify the obvious in the comments. Focus on explaining the logic behind the code<\/li>\n\n\n\n<li><strong>Avoid excessive commenting<\/strong>: While comments are helpful, over-commenting can mess up the code and make it harder to read.<\/li>\n\n\n\n<li><strong>Use comments for documentation<\/strong>: Comments can also serve as a form of documentation providing an overview of the script&#8217;s purpose, input\/output, dependencies and usage instructions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">What is commenting meant for, in programming?<\/h4>\n\n\n\n<p>A comment in programming is a piece of text that is added to the source code of a program to provide explanations, clarifications, or documentation about the code. Comments are not executed by the computer and are ignored during the program&#8217;s execution. They serve as a way for programmers to communicate with other developers, including themselves, to provide context, describe the purpose of certain code sections, or make notes about the code&#8217;s functionality.<\/p>\n\n\n\n<p>Comments are valuable in understanding and maintaining code because they enhance its readability and provide insights into the logic or reasoning behind certain decisions. They can also serve as reminders for future modifications or improvements. Additionally, comments can be used to disable or &#8220;comment out&#8221; sections of code temporarily, preventing them from being executed without actually removing the code.<\/p>\n\n\n\n<p>In summary, comments in programming are essential for code documentation, collaboration, and code maintenance purposes. They help programmers understand the code&#8217;s functionality, facilitate teamwork, and make the code more maintainable and readable in the long run.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Is bash commenting the same as shell script comments?<\/h4>\n\n\n\n<p>Yes, in the context of Bash scripting, commenting is the same as in other shell scripting languages. Bash is a popular Unix shell and command language, and it uses the same syntax for comments as other shell scripting languages like sh or csh.<\/p>\n\n\n\n<p>In Bash, you can use the &#8216;#&#8217; symbol to indicate the start of a comment. Anything written after the &#8216;#&#8217; symbol on the same line is considered a comment and is ignored by the interpreter when executing the script. <a href=\"https:\/\/www.copahost.com\/blog\/compare-strings-bash\/\">Strings<\/a>, numbers, anything after the # will be ignored by the bash interpreter.<\/p>\n\n\n\n<p>Comments in Bash are used to provide explanations, document the code, or temporarily disable certain lines of code without affecting the script&#8217;s functionality.<\/p>\n\n\n\n<p>It&#8217;s worth noting that Bash also supports multiline comments using a combination of the &#8216;:&#8217; (colon) symbol and the &#8216;&lt;&lt;&#8216; operator. This syntax allows you to enclose multiple lines of comments within a block, which can be useful for longer explanations or documentation.<\/p>\n\n\n\n<p>In summary, whether you are writing a Bash script or any other shell script, the concept and usage of comments remain the same. They provide a way to add explanatory text or disable code sections without affecting the script&#8217;s execution.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">How to uncomment a line in bash?<\/h4>\n\n\n\n<p>To uncomment a line in a Bash script, you simply need to remove the &#8216;#&#8217; symbol at the beginning of the line. Here&#8217;s how you can do it:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the Bash script file in a text editor of your choice.<\/li>\n\n\n\n<li>Locate the line that is commented out with the &#8216;#&#8217; symbol.<\/li>\n\n\n\n<li>Remove the &#8216;#&#8217; symbol from the line.<\/li>\n\n\n\n<li>Save the file.<\/li>\n<\/ol>\n\n\n\n<p>By removing the &#8216;#&#8217; symbol, you effectively uncomment the line, allowing it to be interpreted and executed by the Bash interpreter.<\/p>\n\n\n\n<p>It&#8217;s important to note that uncommenting a line means that the line of code will be active and executed when the script runs. Therefore, ensure that you uncomment the line only if you intend for it to be part of the script&#8217;s functionality.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To sum up, Bash commenting is essential when creating scripts. In fact, although bash only supports single-line comments, multi-line comments can be created with a few tricks. This article has covered how to write comments in bash and best practices for commenting.<\/p>\n\n\n\n<p>Thank you for reading<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bash commenting is an important aspect while developing software, as comments provide information and explanations about scripts. These explanations and information not only enable the coder to easily understand their own commands in the future, but also inform other developers about the code. So, in this article, we will explore the use of comments in [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":3168,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-3156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bash commenting: 3 ways to use comments - Copahost<\/title>\n<meta name=\"description\" content=\"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bash commenting: 3 ways to use comments - Copahost\" \/>\n<meta property=\"og:description\" content=\"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\" \/>\n<meta property=\"og:site_name\" content=\"Copahost\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-28T13:08:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-06T03:01:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1364\" \/>\n\t<meta property=\"og:image:height\" content=\"966\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Bruno C\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bruno C\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\"},\"author\":{\"name\":\"Bruno C\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/e6431232917246b162e977b6ae982cf2\"},\"headline\":\"Bash commenting: 3 ways to use comments\",\"datePublished\":\"2023-06-28T13:08:49+00:00\",\"dateModified\":\"2023-07-06T03:01:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\"},\"wordCount\":1058,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png\",\"articleSection\":[\"Linux tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\",\"name\":\"Bash commenting: 3 ways to use comments - Copahost\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png\",\"datePublished\":\"2023-06-28T13:08:49+00:00\",\"dateModified\":\"2023-07-06T03:01:24+00:00\",\"description\":\"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png\",\"width\":1364,\"height\":966},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.copahost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash commenting: 3 ways to use comments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"name\":\"Copahost\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.copahost.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\",\"name\":\"Copahost\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"width\":223,\"height\":40,\"caption\":\"Copahost\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/e6431232917246b162e977b6ae982cf2\",\"name\":\"Bruno C\",\"description\":\"I'm a developer.\",\"url\":\"https:\/\/www.copahost.com\/blog\/author\/buildev\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bash commenting: 3 ways to use comments - Copahost","description":"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.","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:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/","og_locale":"en_US","og_type":"article","og_title":"Bash commenting: 3 ways to use comments - Copahost","og_description":"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.","og_url":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/","og_site_name":"Copahost","article_published_time":"2023-06-28T13:08:49+00:00","article_modified_time":"2023-07-06T03:01:24+00:00","og_image":[{"width":1364,"height":966,"url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png","type":"image\/png"}],"author":"Bruno C","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bruno C","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#article","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/"},"author":{"name":"Bruno C","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/e6431232917246b162e977b6ae982cf2"},"headline":"Bash commenting: 3 ways to use comments","datePublished":"2023-06-28T13:08:49+00:00","dateModified":"2023-07-06T03:01:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/"},"wordCount":1058,"commentCount":0,"publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png","articleSection":["Linux tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/","url":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/","name":"Bash commenting: 3 ways to use comments - Copahost","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png","datePublished":"2023-06-28T13:08:49+00:00","dateModified":"2023-07-06T03:01:24+00:00","description":"Bash commenting is important when developing scripts as it allows to show both how each command works and what the script does.","breadcrumb":{"@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#primaryimage","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/06\/shebang-in-bash.png","width":1364,"height":966},{"@type":"BreadcrumbList","@id":"https:\/\/www.copahost.com\/blog\/bash-commenting-3-ways-to-use-comments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.copahost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bash commenting: 3 ways to use comments"}]},{"@type":"WebSite","@id":"https:\/\/www.copahost.com\/blog\/#website","url":"https:\/\/www.copahost.com\/blog\/","name":"Copahost","description":"","publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.copahost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.copahost.com\/blog\/#organization","name":"Copahost","url":"https:\/\/www.copahost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","width":223,"height":40,"caption":"Copahost"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/e6431232917246b162e977b6ae982cf2","name":"Bruno C","description":"I'm a developer.","url":"https:\/\/www.copahost.com\/blog\/author\/buildev\/"}]}},"_links":{"self":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/comments?post=3156"}],"version-history":[{"count":14,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3156\/revisions"}],"predecessor-version":[{"id":3420,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3156\/revisions\/3420"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media\/3168"}],"wp:attachment":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media?parent=3156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/categories?post=3156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/tags?post=3156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}