diff options
| author | st33v <github@f3rr3t.com> | 2017-01-14 16:52:10 +1100 |
|---|---|---|
| committer | st33v <github@f3rr3t.com> | 2017-01-14 16:52:10 +1100 |
| commit | 331d0b15cef576cdad238e1c1a3ae6d35e18aa1a (patch) | |
| tree | 9736544740393e9024bf05e53ac36a4dfd845199 | |
| parent | b664725be2518a62754264ab9c989399e4d16f3c (diff) | |
test script for managing arrays in bash
| -rwxr-xr-x | arraytest.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arraytest.sh b/arraytest.sh new file mode 100755 index 0000000..1a5e866 --- /dev/null +++ b/arraytest.sh @@ -0,0 +1,11 @@ +#! /bin/bash +# testing array assignment and quoting. + +declare -a arr=("one" "two" "and three" nakedFOUR) + +for x in "${arr[@]}" +do + echo "With quotes \"\$x\"" :"$x": + echo " no quotes \$x" :$x: + echo " curly braces \${x}" :${x}: +done |
