This is broken if "$D1" has a word separator in it. Because you are using `bash`, you could use an array:

    B1ARGS=(-datadir="$D1" -debug)

and then use it thusly:

    some_command "${B1ARGS[@]}"