summaryrefslogtreecommitdiff
path: root/arraytest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'arraytest.sh')
-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