1 # These tests deal with parameters
5 Check setting of positional parameters
8 set -- To comply or not to comply. That is the question.
19 echo 10 again, with feeling: ${10}
31 10 again, with feeling: question.
35 Check expansion of special parameters
36 category: debian,posix
38 set -- To comply or not to comply. That was the question.
43 echo This should be 10: $#.
44 echo Now once more with IFS changed.
50 echo That was exciting.
51 echo "Exit status: $?"
53 To comply or not to comply. That was the question.
54 To comply or not to comply. That was the question.
55 To comply or not to comply. That was the question.
56 To comply or not to comply. That was the question.
57 This should be 10: 10.
58 Now once more with IFS changed.
59 To comply or not to comply. That was the question.
60 To comply or not to comply. That was the question.
61 To comply or not to comply. That was the question.
62 To:comply:or:not:to:comply.:That:was:the:question.
69 category: debian,posix
82 Check parameter expansions
83 category: debian,posix
87 echo ${FULLPARAMETER:-one}
88 echo ${EMPTYPARAMETER:-two}
89 echo ${NULLPARAMETER:-three}
90 echo ${FULLPARAMETER-four}
91 echo ${EMPTYPARAMETER-five}
92 echo ${NULLPARAMETER-six}
93 echo ${FULLPARAMETER:=seven}
94 echo ${EMPTYPARAMETER:=eight}
95 echo ${FULLPARAMETER:+nine}
96 echo ${EMPTYPARAMETER:+ten}
97 echo ${NEWEMPTYPARAMETER:+eleven}
98 echo ${NULLPARAMETER:+twelve}
99 echo ${FULLPARAMETER+thirteen}
100 echo ${EMPTYPARAMETER+fourteen}
101 echo ${NEWEMPTYPARAMETER+fifteen}
102 echo ${NULLPARAMETER?seventeen}
103 echo ${FULLPARAMETER:?eighteen}
104 echo ${EMPTYPARAMETER:?nineteen}
127 Check parameter expansion substrings
128 category: debian,posix
131 echo ${TESTSTRING%[A-Z]?}
132 echo ${TESTSTRING%%[A-Z]?}
133 echo ${TESTSTRING#[a-z]?}
134 echo ${TESTSTRING##[a-z]?}