Show an example of when concatenating a string and an array is intended

jzinn
2018-06-04 16:39:23 -07:00
parent 1ca62fc68c
commit 44839cb533

@@ -24,4 +24,31 @@ If the intention is to provide each array element as a separate argument, put th
### Exceptions
None.
```sh
command_foo() {
echo "In foo"
echo "\$1 == $1 == aaa"
echo "\$2 == $2 == bbb"
}
command_bar() {
echo "In bar"
}
command_baz() {
echo "In baz"
}
main() {
case "$1" in
foo | bar | baz )
command_"$@"
;;
* )
printf "Error: %s\n" "Unrecognized command"
;;
esac
}
main foo aaa bbb
```