From dc268515b7c3725fa8a1aaf3e7ef45e9538208b3 Mon Sep 17 00:00:00 2001 From: Jackson Bailey Date: Wed, 4 May 2022 15:58:25 -0400 Subject: [PATCH] Variable substitution changes Clarify documentation and give a few more examples --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47fc319..32aa63c 100644 --- a/README.md +++ b/README.md @@ -135,9 +135,19 @@ $HOSTNAME current hostname ##### Variable substitution within quotes ```bash # foo=bar - echo "'$foo'" -#'bar' -# double/single quotes around single quotes make the inner single quotes expand variables +echo $foo +# bar +echo "$foo" +# bar +# single quotes cause variables to not be expanded +echo '$foo' +# $foo +# single quotes within double quotes will not cancel expansion and will be part of the output +echo "'$foo'" +# 'bar' +# doubled single quotes act as double quotes making variables expand +echo ''$foo'' +# bar ``` ##### Get the length of variable ```bash