aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-08-15 01:20:42 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-08-15 03:48:43 +0200
commiteaa3d37c43e2657f53559d427ad91c6512f287db (patch)
treeb357a7459b77e7ce8e2115e96d5739a97cc1c85d
parentb84cc136193917ae80438f03aa3050e60881abe7 (diff)
downloadtmp-eaa3d37c43e2657f53559d427ad91c6512f287db.tar.gz
Copy bash arrays
-rwxr-xr-xtmp.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tmp.py b/tmp.py
index 0691ea0..638f064 100755
--- a/tmp.py
+++ b/tmp.py
@@ -58,9 +58,10 @@ URLS_tmp['target_url']='https://mcepl.fedorapeople.org/tmp/'
URLS_tmp['shorten_api']='https://da.gd/s?url='
declare -A URLS
-URLS['barstool']=URLS_barstool[@]
-URLS['wotan']=URLS_wotan[@]
-URLS['tmp']=URLS_tmp[@]
+# b=( "${a[@]}" )
+URLS['barstool']=( "${URLS_barstool[@]}" )
+URLS['wotan']=( "${URLS_wotan[@]" )
+URLS['tmp']=( "${URLS_tmp[@]" )
# Requires GNU sed
CMDNAME="$(echo "$(basename $0)"|sed 's/./\L&/g')"
@@ -68,14 +69,14 @@ declare -A config
echo ${@:1}
-for elem in ${URLS[$CMDNAME]}
+for elem in "${URLS[$CMDNAME]}"
do
# echo "key : ${elem}" -- "value: ${config[${elem}]}"
config[${elem}]=${URLS[$CMDNAME][${elem}]}
done
-echo ${config[@]}
-echo ${!config[@]}
+echo "${config[@]}"
+echo "${!config[@]}"
exit 0