diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-08-15 01:20:42 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-08-15 03:48:43 +0200 |
commit | eaa3d37c43e2657f53559d427ad91c6512f287db (patch) | |
tree | b357a7459b77e7ce8e2115e96d5739a97cc1c85d | |
parent | b84cc136193917ae80438f03aa3050e60881abe7 (diff) | |
download | tmp-eaa3d37c43e2657f53559d427ad91c6512f287db.tar.gz |
Copy bash arrays
-rwxr-xr-x | tmp.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 |