A solução que encontrei foi dividir var2
linha por linha em while
loop:
#!/bin/bash
var0="/tmp/a0 1"
var1="/tmp/a1 1"
var2="$(echo -e "$var0\n$var1")"
totalsize=0; #this will make script return 0 if var2 somehow contains empty lines only
while read "opened_file" #for each file in list do
do
if [ ! -z "$opened_file" ]; then #if variable is not empty
tmp1="$(du -b "$opened_file" | cut -d" " -f1)" #get size of current file and strip unnecessary fields
totalsize=$(($totalsize + $tmp1))
fi
done <<< "$(echo -e "$var2")"
echo "$totalsize"