- # Assumes we are in the 21st century.
- ls -1dvrq $root_dir/btrbk/$subvol_dir.20* >$tmpf
- mapfile -t snaps <$tmpf
- if [[ ! ${snaps[*]} ]]; then
+ # note: relying on null glob
+ ls_args=($root_dir/btrbk/$subvol_dir.20*)
+ if (( ${#ls_args[@]} )); then
+ # Assumes we are in the 21st century.
+ ls -1dvrq $root_dir/btrbk/$subvol_dir.20* >$tmpf
+ mapfile -t snaps <$tmpf
+ else