{"id":2345,"date":"2019-02-28T15:35:52","date_gmt":"2019-02-28T15:35:52","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2345"},"modified":"2019-02-28T16:05:25","modified_gmt":"2019-02-28T16:05:25","slug":"bash-ansi-c-quoting","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/bash-ansi-c-quoting\/","title":{"rendered":"Bash ANSI-C Quoting"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Pulled from https:\/\/www.gnu.org\/software\/bash\/manual\/bashref.html#ANSI_002dC-Quoting<\/h4>\n\n\n\n<p>As a side note there is a lot of good bash info out here.  https:\/\/www.gnu.org\/software\/bash\/manual\/bashref.html<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>3.1.2.4 ANSI-C Quoting<\/strong><\/p>\n\n\n\n<p>Words of the form <code>$'string'<\/code> are treated specially.  The\nword expands to string, with backslash-escaped characters replaced\nas specified by the ANSI C standard.  Backslash escape sequences, if\npresent, are decoded as follows:\n<code>\\a<\/code><\/p>\n\n\n\n<p>alert (bell)\n<code>\\b<\/code><\/p>\n\n\n\n<p>backspace\n<code>\\e<\/code><code>\\E<\/code><\/p>\n\n\n\n<p>an escape character (not ANSI C)\n<code>\\f<\/code><\/p>\n\n\n\n<p>form feed\n<code>\\n<\/code><\/p>\n\n\n\n<p>newline\n<code>\\r<\/code><\/p>\n\n\n\n<p>carriage return\n<code>\\t<\/code><\/p>\n\n\n\n<p>horizontal tab\n<code>\\v<\/code><\/p>\n\n\n\n<p>vertical tab\n<code>\\\\<\/code><\/p>\n\n\n\n<p>backslash\n<code>\\'<\/code><\/p>\n\n\n\n<p>single quote\n<code>\\\"<\/code><\/p>\n\n\n\n<p>double quote\n<code>\\?<\/code><\/p>\n\n\n\n<p>question mark <code>\\nnn<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Some examples<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo Hello $'\\t' World<br><\/pre>\n\n\n\n<p>Returns &#8220;Hello World&#8221; with a tab space between both words.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo Hello $'\\n' World<\/pre>\n\n\n\n<p>Returns Hello on one line and World on the second<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo \"\\\"Hello World\\\"\"<\/pre>\n\n\n\n<p>Returns &#8220;Hello World&#8221; inside double quotes<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pulled from https:\/\/www.gnu.org\/software\/bash\/manual\/bashref.html#ANSI_002dC-Quoting As a side note there is a lot of good bash info out here. https:\/\/www.gnu.org\/software\/bash\/manual\/bashref.html 3.1.2.4 ANSI-C Quoting Words of the form $&#8217;string&#8217; are treated specially. The word expands to string, with backslash-escaped characters replaced as specified &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/bash-ansi-c-quoting\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[591,211,7,405,590],"class_list":["post-2345","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ansi","tag-bash","tag-linux-2","tag-scripting","tag-shell"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2345"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2345\/revisions"}],"predecessor-version":[{"id":2347,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2345\/revisions\/2347"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}