summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorst33v <github@f3rr3t.com>2017-01-14 16:52:10 +1100
committerst33v <github@f3rr3t.com>2017-01-14 16:52:10 +1100
commit331d0b15cef576cdad238e1c1a3ae6d35e18aa1a (patch)
tree9736544740393e9024bf05e53ac36a4dfd845199
parentb664725be2518a62754264ab9c989399e4d16f3c (diff)
test script for managing arrays in bash
-rwxr-xr-xarraytest.sh11
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