mo/demo/associative-arrays
2023-04-04 02:00:31 -05:00

20 lines
286 B
Bash
Executable File

#!/usr/bin/env bash
cd "$(dirname "$0")" # Go to the script's directory
declare -A DATA
DATA=([one]=111 [two]=222)
. ../mo
cat <<EOF | mo
Accessing data directly:
DATA: {{DATA}}
One: {{DATA.one}}
Two: {{DATA.two}}
Things in DATA:
{{#DATA}}
Item: {{.}}
{{/DATA}}
EOF