This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context: | |
Pass array to function, where one or more elements of the array have embedded spaces. | |
Goal: Have the embedded spaces respected in the array processed by the function. | |
############### The script | |
#!/usr/bin/env bash | |
set -eu | |
function echo_passed_array() { | |
list_of_options=("$@") | |
echo "List of options [0]: ${list_of_options[0]}" | |
echo "List of options [1]: ${list_of_options[1]}" |
NewerOlder