I've used export, and it works as expected, thank you.
Bash always surprised me in how it process the command line, never was able to correctly predict how it works, and never took the time to read the docs.
For example
aaa@zub:~$ X1=present echo $X1
aaa@zub:~$ echo $X1
aaa@zub:~$ X1=present; echo $X1
present
aaa@zub:~$ echo $X1
present
aaa@zub:~$ unset X1
aaa@zub:~$ echo $X1
aaa@zub:~$ X1=present; \
> echo $X1
present
aaa@zub:~$
The last format is what I've used with borg, but it didn't work, maybe borg spawns some other hidden instance of bash, and that's why the variable is not seen, IDK. With export it works as expected.
For now I think I'll stay with Borg for backup. It's a pity to use ZFS on the desktop and to use yet another thing for backup, but the NAS I have is a dedicated RAID 5 with ARM and some frozen in time Linux. The NAS knows Samba 1.0 and NFS, and it is rather slow, only 10MB/s max, thought the LAN link is 1GBps. Only rarely start it for manual backups a few times a year. So far it was very reliable (for ~10 years), and I'm afraid to mess with it trying to upgrade, or to reformat it as ZFS.
Since we are at Borg backup, there is GUI for it, called Vorta, but I've decided to use the command line and craft my own scripts for manual backup. Regarding Vorta, I've noticed that if the password manager is disabled (so no keyring), then Vorta saves the password in clear! in a table in its own database and the table remains as a leftover even after uninstalling Vorta, so I filed a security bug for Vorta and uninstall it.
Borg is quite fast at incremental backups. For example a few hundreds GB that took many hours finishes in less than 15 minutes when doing incremental backups. Before borg I was doing manual copy/paste then delete the old version, which usually took a whole day, if not a whole weekend to complete!