From 331d0b15cef576cdad238e1c1a3ae6d35e18aa1a Mon Sep 17 00:00:00 2001 From: st33v Date: Sat, 14 Jan 2017 16:52:10 +1100 Subject: test script for managing arrays in bash --- arraytest.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 arraytest.sh 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 -- cgit v1.3