Version A: you explicitly specify to what dbf want append
append_to="fff.dbf"
find . -maxdepth 1 -name \*.dbf -print0 | grep -zv "^$append_to$" | xargs -0 -n1 -I % echo ogr2ogr -append "$append_to" "%"
Variant B: appending to the 1st dbf (1st by ls)
append_to=$(ls -1 *.dbf | head -1)
find . -maxdepth 1 -name \*.dbf -print0 | grep -zv "^$append_to$" | xargs -0 -n1 -I % echo ogr2ogr -append "$append_to" "%"
Both are now in the "dry run" mode - only shows what will do. When satisfied remove the echo
from the xargs. The second line is same for both versions.
pure bash
IFS=$'\t\n' #don't need this line when your filenames doesn't contain spaces
declare -a dbfs=(*.dbf)
unset $IFS #don't need this line when your filenames doesn't contain spaces
append_to=${dbfs[0]}
unset dbfs[0]
for dbf in ${dbfs[@]}
do
echo ogr2ogr -append "$append_to" "$dbf"
done