summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-vars/var_bash1a.tests (plain)
blob: 551dd9accc617d73deddc4f15e86845e3b572c3d
1parameter=abcdef
2offset=2
3noffset=-2
4echo "parameter '${parameter}'"
5echo "varoffset2 '${parameter:${offset}}'"
6echo "varoffset-2 '${parameter:${noffset}}'"
7echo "literal '2' '${parameter:2}'"
8# This is not inrpreted as ${VAR:POS{:LEN}},
9# but as ${VAR:=WORD} - if VAR is unset or null, substitute WORD
10echo "literal '-2' '${parameter:-2}'"
11echo "literal ' -2' '${parameter: -2}'"
12