{"id":21646,"date":"2023-09-14T10:35:20","date_gmt":"2023-09-14T10:35:20","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=21646"},"modified":"2024-01-23T05:28:05","modified_gmt":"2024-01-23T05:28:05","slug":"bash-double-quotes","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/","title":{"rendered":"Understanding Double Quotes in Bash [3 Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\">Double quotes are a versatile component in Bash that allows <strong>variable <\/strong>and <strong>command substitution<\/strong>, insertion of <strong>escape sequences<\/strong>, and <strong>special characters<\/strong>. The more you use double quotes, the more you will construct meaningful strings or dynamic content. In this article, you will learn how to use <strong>Bash double quotes<\/strong> to make an intuitive interaction with your scripts.<\/p>\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\/quotes\/double-quotes\/#Key_Takeaways\" >Key Takeaways<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Context_of_Double_Quotes_in_Bash\" >Context of Double Quotes in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Double_Quotes_in_Terms_of_Word_Splitting\" >Double Quotes in Terms of Word Splitting<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#3_Examples_of_Double_Quotes_in_Bash\" >3 Examples of Double Quotes in Bash<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Example_1_History_Expansion_Using_Double_Quotes_in_Bash\" >Example 1: History Expansion Using Double Quotes in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Example_2_Passing_Arguments_Using_Double_Quotes_in_Bash\" >Example 2: Passing Arguments Using Double Quotes in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Example_3_Dealing_With_Nested_Double_Quotes\" >Example 3: Dealing With Nested Double Quotes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#People_Also_Ask\" >People Also Ask<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Key_Takeaways\"><\/span>Key Takeaways<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Learning about the double quotes in Bash.<\/li>\n<li>Exploring practical examples of double quotes in Bash.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Context_of_Double_Quotes_in_Bash\"><\/span>Context of Double Quotes in Bash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Double quote (&#8221; &#8220;)<\/strong> is a flexible quoting type that serves multiple purposes in Bash such as defining strings, preventing word splitting, command and variable interpolation, and aiding the escape sequences. These double quotes are almost similar to single quotes in terms of preserving <strong>special characters<\/strong>. However, there are some exceptions:<\/p>\n<p><span style=\"color: #800080;\"><strong>Exceptions &gt;<\/strong><\/span><\/p>\n<ul>\n<li><strong>$ (Dollar-sign) <\/strong>\u2192 For variable expansion and command substitution.<\/li>\n<li><strong>! (Exclamation symbol) <\/strong>\u2192 For history expansion.<\/li>\n<li><strong>` (Backticks) <\/strong>\u2192 For altering commands.<\/li>\n<li><strong>\\ (Backslash) <\/strong>\u2192 For escaping specific characters.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Double_Quotes_in_Terms_of_Word_Splitting\"><\/span>Double Quotes in Terms of Word Splitting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/introduction\/what-is-bash-scripting\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash scripting<\/strong><\/a>, it\u2019s so frequent to use commands or string values including characters like \u2018<strong>space<\/strong>\u2019, \u2018<strong>newline<\/strong>\u2019, and \u2018<strong>tab<\/strong>\u2019 typically stored in the special shell variable <strong>IFS (Internal Field Separator)<\/strong>. Bash breaks the input commands including these characters into words. Thus word splitting occurs. In such a situation, you can enclose these characters within <strong>double quotes<\/strong> and prevent the <strong>word-splitting<\/strong> issue by making Bash interpret them as single-string values.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Examples_of_Double_Quotes_in_Bash\"><\/span>3 Examples of Double Quotes in Bash<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In the following section you will find a glimpse of <strong>three <\/strong>examples of double quotes in <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash<\/strong><\/a>:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_1_History_Expansion_Using_Double_Quotes_in_Bash\"><\/span>Example 1: History Expansion Using Double Quotes in Bash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can use the <strong>history expansion operator (!) <\/strong>within double quotes to re-execute any command from your history sessions. Follow the steps below for history expansion within double quotes:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a Open your <strong>Ubuntu <\/strong><a href=\"https:\/\/linuxsimply.com\/what-is-terminal-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>Terminal<\/strong><\/a> and navigate to <strong>Desktop<\/strong> by running:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">cd Desktop<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/cd-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>cd<\/strong><\/a>: It helps to navigate to a directory.<\/li>\n<li><strong>Desktop<\/strong>: The directory I navigated.<\/li>\n<\/ul>\n<\/div><\/div>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-21664\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img1-Navigating-to-Desktop-2.png\" alt=\"Navigating to Desktop\" width=\"700\" height=\"110\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img1-Navigating-to-Desktop-2.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img1-Navigating-to-Desktop-2-300x47.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u278b Run the following <a href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>echo commands<\/strong><\/a> for history expansion within double quotes:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo \u201cHistory expansion within double quotes: !-1\u201d<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>echo<\/strong>: Displays text to the terminal.<\/li>\n<li style=\"text-align: justify;\"><strong>!-1<\/strong>: Here, \u2018<strong>i<\/strong>\u2019 initiates the <strong>history expansion<\/strong>. And \u2018<strong>-1<\/strong>\u2019 is the <strong>history reference<\/strong> that tells Bash to execute the command that was executed exactly before the current command in your command history.<\/li>\n<\/ul>\n<\/div><\/div>\n<pre><code class=\"language-bash\" data-line=\"\">echo \u201cHistory expansion within double quotes: !-3\u201d<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li style=\"text-align: justify;\"><strong>!-3<\/strong>: Here, \u2018<strong>i<\/strong>\u2019 initiates the <strong>history expansion<\/strong>. And \u2018<strong>-3<\/strong>\u2019 is the <strong>history reference<\/strong> that tells Bash to execute the command that was executed <strong>three <\/strong>commands before the current command in your command history.<\/li>\n<\/ul>\n<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21666\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img2-History-expansion-within-double-quotes.png\" alt=\"History expansion within double quotes\" width=\"825\" height=\"345\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img2-History-expansion-within-double-quotes.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img2-History-expansion-within-double-quotes-300x125.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img2-History-expansion-within-double-quotes-768x321.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">From the image, you can see that whenever I have used the <strong>history expansion operator<\/strong> with a <strong>history reference number<\/strong> enclosed in <strong>double quotes<\/strong>, Bash recalls and executes the specific command according to the given reference from the command history.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_2_Passing_Arguments_Using_Double_Quotes_in_Bash\"><\/span>Example 2: Passing Arguments Using Double Quotes in Bash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash, you can easily pass arguments or parameters to the functions or shell scripts by enclosing them within double quotes. Following is an example with several steps to visualize the fact:<\/p>\n<p><span style=\"color: #800080;\"><strong>Steps to Follow &gt;<\/strong><\/span><\/p>\n<p>\u278a Open a script in the <strong>Nano text editor<\/strong> by running the following command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">nano function.sh<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/nano-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>nano<\/strong><\/a>: A text editor.<\/li>\n<li><strong>function.sh<\/strong>: This is a script. Here, I have named the script <strong>\u2018function.sh\u2019<\/strong>. You can name any of your choices.<\/li>\n<\/ul>\n<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21668\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img3-Open-the-file-in-Nano-editor.png\" alt=\"Open the file in Nano editor\" width=\"582\" height=\"136\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img3-Open-the-file-in-Nano-editor.png 582w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img3-Open-the-file-in-Nano-editor-300x70.png 300w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/p>\n<p>\u278b Now, <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/writing\/\" target=\"_blank\" rel=\"noopener\"><strong>write the following script<\/strong><\/a> inside the editor:<\/p>\n<p><span style=\"color: #800080;\"><strong>Script (function.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nfunction argcount() {\n\u00a0echo $#\nfor p in &quot;$@&quot;; do\n\u00a0echo $p\ndone\n}\n\nargcount &quot;Now, I am in $(pwd).&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p style=\"text-align: justify;\">Here, in <strong>#!\/bin\/bash<\/strong>, \u2018<strong>#!<\/strong>\u2019 is called <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/writing\/what-is-shebang\/\" target=\"_blank\" rel=\"noopener\">\u2018<strong>Shebang<\/strong>\u2019 or \u2018<strong>Hashbang<\/strong>\u2019<\/a>. The portion <strong>function argcount() {&#8230;} <\/strong>demonstrates a function \u2018<strong>argcount<\/strong>\u2019 that counts and prints the user input parameters one after one. In the line <strong>echo $#<\/strong>, the \u2018<strong>$#<\/strong>\u2019 counts the argument and the <strong>echo <\/strong>command displays the number of the argument.<\/p>\n<p style=\"text-align: justify;\">Next, \u2018<strong>for p in &#8220;$@&#8221;; do \u2026 done<\/strong>\u2019 depicts a loop that iterates through all the arguments passed to the function where \u2018<strong>&#8220;$@&#8221;<\/strong>\u2019 indicates all arguments to be treated as <strong>separate words<\/strong>. Finally, the line <strong>argcount &#8220;Now, I am in $(pwd).&#8221; <\/strong>calls the function \u2018<strong>argcount<\/strong>\u2019 with an argument<strong> &#8220;Now, I am in $(pwd).&#8221; <\/strong>that is a string encased in <strong>double-quotes<\/strong>.<\/p>\n<\/div><\/div>\n<p><a id=\"Steps-to-Follow\"><\/a>\u278c Then, press <strong>CTRL+S<\/strong> to save the file &amp; press <strong>CTRL+X <\/strong>to exit.<\/p>\n<p>\u278d After that, use the command below to <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/make-file-executable\/\" target=\"_blank\" rel=\"noopener\"><strong>make the script executable<\/strong><\/a>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">chmod u+x function.sh<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/chmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>chmod<\/strong><\/a><strong>: <\/strong>Changes the permission of the files and directories.<\/li>\n<li><strong>u+x: <\/strong>Adds the executable permission for the user.<\/li>\n<li><strong>function.sh: <\/strong>The file which you want to make executable.<\/li>\n<\/ul>\n<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21669\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img4-Adding-executable-permission-to-the-script.png\" alt=\"Adding executable permission to the script\" width=\"700\" height=\"167\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img4-Adding-executable-permission-to-the-script.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img4-Adding-executable-permission-to-the-script-300x72.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>\u278e Finally, <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/basics\/executing\/run-a-script\/\" target=\"_blank\" rel=\"noopener\"><strong>run the script<\/strong><\/a> by the following command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">.\/function.sh<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34600\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img5-Parameters-within-double-quotes-passed-to-the-function.png\" alt=\"Parameters within double quotes passed to the function\" width=\"700\" height=\"173\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img5-Parameters-within-double-quotes-passed-to-the-function.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img5-Parameters-within-double-quotes-passed-to-the-function-300x74.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">From the image, you can see that the script calls the particular function \u2018<strong>argcount<\/strong>\u2019 and displays the <strong>argument count <\/strong>which is <strong>1<\/strong> in this case. Also, from the line \u2018<strong>Now, I am in \/home\/nadiba<\/strong>\u2019 you can understand that the script prints the <strong>entire string<\/strong> including the <strong>command substitution<\/strong> of <strong>$pwd<\/strong> within <strong>double quotes<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example_3_Dealing_With_Nested_Double_Quotes\"><\/span>Example 3: Dealing With Nested Double Quotes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To employ the nested double quotes, you can use a <strong>backslash <\/strong>before the <strong>inner double quotes<\/strong> like \u2018<strong>\\&#8221;<\/strong>\u2019 to indicate the double quotes as <strong>literal characters<\/strong> within the string.<\/p>\n<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;\">You can follow the <a href=\"#Steps-to-Follow\"><strong>Steps of Example 2<\/strong><\/a>, to save &amp; make the script executable.<\/div><\/div>\n<p><span style=\"color: #800080;\"><strong>Script (doublenest.sh) &gt;<\/strong><\/span><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Diplaying output with double quoted word\necho &quot;This is \\&quot;LinuxSimply\\&quot;.&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>In the line <strong>echo &#8220;This is \\&#8221;LinuxSimply\\&#8221;.&#8221;<\/strong>, the <strong>echo <\/strong>command prints the line with a nested double-quoted word <strong>&#8220;Linuxsimply&#8221;<\/strong>.<\/p>\n<\/div><\/div>\n<p>Now, run the script by the following command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">.\/doublenest.sh<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-21670\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img6-Output-of-nested-double-quotes.png\" alt=\"Output of nested double quotes\" width=\"700\" height=\"168\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img6-Output-of-nested-double-quotes.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/img6-Output-of-nested-double-quotes-300x72.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>The above image depicts that after running the script, the <strong>nested double quote<\/strong> has been appended to the word <strong>LinuxSimply<\/strong> within the string.<\/p>\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;\">Hope you have understood well how to work with <strong>double quotes in Bash<\/strong> by reading the whole article. So, to conclude, it\u2019s very important to deal with double quotes in proper ways, for proper conditions like <strong>variable &amp; command interpretation<\/strong>, <strong>passing function parameters,<\/strong> etc.<\/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<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>Can I prevent variable expansion within a double-quoted string in Bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><strong>Yes<\/strong>, you can prevent <strong>variable expansion<\/strong> within a double-quoted string in Bash by <strong>escaping the dollar symbol<\/strong> with a <strong>backslash <\/strong>(<strong>\\$<\/strong>).<\/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 employ double quotes for creating multiline strings in Bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">To employ <strong>double quotes<\/strong> for creating <strong>multiline strings<\/strong>, append <strong>newline characters<\/strong> (<strong>\\n<\/strong>) within the strings in Bash.<\/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>Does Bash support a literal double quote within a double-quoted string?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><strong>Yes<\/strong>, Bash supports a <strong>literal double quote<\/strong> within a double-quoted string.<\/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>Does Bash allow double quotes within a regular expression pattern?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><strong>Yes<\/strong>, Bash allows the use of double quotes within e regular expression when the pattern is enclosed with a <strong>single quote<\/strong>.<\/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\/quotes\/what-is-quoting\/\" target=\"_blank\" rel=\"noopener\">What is Quoting in Bash? [5 Hacks You Didn\u2019t Know]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/single-quotes\/\" target=\"_blank\" rel=\"noopener\">Understanding Single Quotes in Bash [2 Examples With Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/single-vs-double-quotes\/\" target=\"_blank\" rel=\"noopener\">Bash Single Vs Double Quotes [3 Cases to Differentiate]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/escape-quotes\/\" target=\"_blank\" rel=\"noopener\">Escape Quotes in Bash<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Quotes&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1065921,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/\" target=\"_blank\" rel=\"noopener\">Bash Quotes<\/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;21646&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;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&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;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Understanding Double Quotes in Bash [3 Examples]&quot;,&quot;width&quot;:&quot;0&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: 0px;\">\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            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Double quotes are a versatile component in Bash that allows variable and command substitution, insertion of escape sequences, and special &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Understanding Double Quotes in Bash [3 Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#more-21646\" aria-label=\"Read more about Understanding Double Quotes in Bash [3 Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314905,"featured_media":21671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[129],"class_list":["post-21646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-bash-quotes","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>Understanding Double Quotes in Bash [3 Examples]<\/title>\n<meta name=\"description\" content=\"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.\" \/>\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\/quotes\/double-quotes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Double Quotes in Bash [3 Examples]\" \/>\n<meta property=\"og:description\" content=\"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-14T10:35:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-23T05:28:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.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=\"Nadiba Rahman\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nadiba Rahman\" \/>\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\\\/quotes\\\/double-quotes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/\"},\"author\":{\"name\":\"Nadiba Rahman\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/69b717a03a5d9dc48e683aaffe22d33f\"},\"headline\":\"Understanding Double Quotes in Bash [3 Examples]\",\"datePublished\":\"2023-09-14T10:35:20+00:00\",\"dateModified\":\"2024-01-23T05:28:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/\"},\"wordCount\":1199,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Feature-image-Bash-double-quotes.png\",\"keywords\":[\"bash quotes\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/\",\"name\":\"Understanding Double Quotes in Bash [3 Examples]\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Feature-image-Bash-double-quotes.png\",\"datePublished\":\"2023-09-14T10:35:20+00:00\",\"dateModified\":\"2024-01-23T05:28:05+00:00\",\"description\":\"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Feature-image-Bash-double-quotes.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Feature-image-Bash-double-quotes.png\",\"width\":400,\"height\":400,\"caption\":\"Feature image-Bash double quotes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/double-quotes\\\/#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 Quotes\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/quotes\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Understanding Double Quotes in Bash [3 Examples]\"}]},{\"@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\\\/69b717a03a5d9dc48e683aaffe22d33f\",\"name\":\"Nadiba Rahman\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Nadiba-Rahman-II-96x96.png\",\"caption\":\"Nadiba Rahman\"},\"description\":\"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/nadiba.rahman?mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/nadiba-rahman-443459171\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/nadiba\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Double Quotes in Bash [3 Examples]","description":"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.","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\/quotes\/double-quotes\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Double Quotes in Bash [3 Examples]","og_description":"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","article_published_time":"2023-09-14T10:35:20+00:00","article_modified_time":"2024-01-23T05:28:05+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.png","type":"image\/png"}],"author":"Nadiba Rahman","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nadiba Rahman","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/"},"author":{"name":"Nadiba Rahman","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/69b717a03a5d9dc48e683aaffe22d33f"},"headline":"Understanding Double Quotes in Bash [3 Examples]","datePublished":"2023-09-14T10:35:20+00:00","dateModified":"2024-01-23T05:28:05+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/"},"wordCount":1199,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.png","keywords":["bash quotes"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/","name":"Understanding Double Quotes in Bash [3 Examples]","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.png","datePublished":"2023-09-14T10:35:20+00:00","dateModified":"2024-01-23T05:28:05+00:00","description":"Utilize Bash double quotes properly to reduce unintended errors and make more dynamic, interactive and effective Bash scripts.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Feature-image-Bash-double-quotes.png","width":400,"height":400,"caption":"Feature image-Bash double quotes"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/double-quotes\/#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 Quotes","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/quotes\/"},{"@type":"ListItem","position":4,"name":"Understanding Double Quotes in Bash [3 Examples]"}]},{"@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\/69b717a03a5d9dc48e683aaffe22d33f","name":"Nadiba Rahman","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Nadiba-Rahman-II-96x96.png","caption":"Nadiba Rahman"},"description":"Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor\u2019s degree in Electronics &amp; Telecommunication Engineering from Rajshahi University of Engineering &amp; Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/nadiba.rahman?mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/nadiba-rahman-443459171"],"url":"https:\/\/linuxsimply.com\/author\/nadiba\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/21646","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\/314905"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=21646"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/21646\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/21671"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=21646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=21646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=21646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}