digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.6k stars 117 forks source link

btrfs-mail: declare the associative arrays #530

Closed aleksejrs closed 1 year ago

aleksejrs commented 1 year ago

It does not work for me without this (the blocks overwrite each other):

declare -A rsync_src
declare -A rsync_dst
declare -A rsync_log
declare -A rsync_rsh
declare -A rsync_opt
digint commented 1 year ago

Added declare statements in: b63609c29871c9ab5f16bf1726b2541f0e73ff7f

my version of bash seems to be fine without declaring associative arrays:

# bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

the blocks overwrite each other

not sure what you mean with than, works for me

aleksejrs commented 1 year ago

bash 5.2 had some changes related to arrays. IIRC, the undeclared names were processed as ordinary variables.

digint commented 1 year ago

I have checked master (db45f0b09c3cda49aca5b3cc6b1150bac3e87fad) with and without declare, strangely (?) works fine for me with both bash-5.1 and bash-5.2.

should be fine, @aleksejrs please reopen if not