Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-07-06 19:50:42 +02:00
parent 5dad7bdc3b
commit 74d20e6379
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ echo "parameter '${parameter}'"
echo "varoffset2 '${parameter:${offset}}'"
echo "varoffset-2 '${parameter:${noffset}}'"
echo "literal '2' '${parameter:2}'"
# This is not inrpreted as ${VAR:POS{:LEN}},
# This is not interpreted as ${VAR:POS{:LEN}},
# but as ${VAR:=WORD} - if VAR is unset or null, substitute WORD
echo "literal '-2' '${parameter:-2}'"
echo "literal ' -2' '${parameter: -2}'"

View File

@ -5,7 +5,7 @@ echo "parameter '${parameter}'"
echo "varoffset2 '${parameter:${offset}}'"
echo "varoffset-2 '${parameter:${noffset}}'"
echo "literal '2' '${parameter:2}'"
# This is not inrpreted as ${VAR:POS{:LEN}},
# This is not interpreted as ${VAR:POS{:LEN}},
# but as ${VAR:=WORD} - if VAR is unset or null, substitute WORD
echo "literal '-2' '${parameter:-2}'"
echo "literal ' -2' '${parameter: -2}'"