I want to merge all gpx files from folder and that could be done with command.
Code:
gpsbabel -i gpx `ls upload/*.gpx | sed "s/^/-f /g"` -o gpx -F sve.gpx
This works but there is problem when there is file with space in the name. I have tried to use quotas with command
Code:
gpsbabel -i gpx `ls upload/*.gpx | sed "s/^/-f \'/g" | sed "s/$/'/g"` -o gpx -F sve.gpx
but than:
Code:
GPX: Cannot open file ''upload/1b'!
I have figured out that there is problem with word splitting in command substitution but I couldn't find solution.
Could anyone help me?