From e2d2eef9c2ac1b02fb143d10961a041ae27ec888 Mon Sep 17 00:00:00 2001 From: aswin020 Date: Thu, 15 Feb 2018 14:53:24 +0530 Subject: [PATCH 1/2] Adding comments section Single line and multi-line comments are added. --- bash.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bash.md b/bash.md index b35655512..d80c9b2b3 100644 --- a/bash.md +++ b/bash.md @@ -172,6 +172,22 @@ DIR=${SRC%$BASE} #=> "/path/to" (dirpath) | `${FOO/%from/to}` | Replace suffix | | `${FOO/#from/to}` | Replace prefix | +### Comments + +`# Single line comment` +```bash +: ' +This is a +multi line +comment +' +``` +```bash +# This is also +# a multi line +# Comment +``` + ### Substrings | `${FOO:0:3}` | Substring _(position, length)_ | From b95dacc8fa3e987b814b9020eb41f99d681d8c1f Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 15 Mar 2018 17:33:21 +0800 Subject: [PATCH 2/2] bash: update multiline comments examples --- bash.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bash.md b/bash.md index d80c9b2b3..b1396ec73 100644 --- a/bash.md +++ b/bash.md @@ -174,19 +174,17 @@ DIR=${SRC%$BASE} #=> "/path/to" (dirpath) ### Comments -`# Single line comment` +```bash +# Single line comment +``` + ```bash : ' This is a -multi line +multi line comment ' ``` -```bash -# This is also -# a multi line -# Comment -``` ### Substrings @@ -460,7 +458,7 @@ set -o globdots # Wildcards match dotfiles ("*.sh" => ".foo.sh") set -o globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb') ``` -Set `GLOBIGNORE` as a colon-separated list of patterns to be removed from glob +Set `GLOBIGNORE` as a colon-separated list of patterns to be removed from glob matches. History