Thanks wyohman, I now just get the first '
The line in the specfile is currently this:
xml ed ...
...
-s "/actions/action[last()]" -t elem -n command -v "xterm %{xtermopt} +hold -e bunzip2 '%f' && xz - -9 %d/'`basename '%f' .bz2'`" \
...
..
and it's the `basename '%f' .bz2'` that evaluates too early (the trick is to insert the command as a menu option for Thunar fm to be able to repackage a bz2 archive to xz format), ie.
bunzip2 '%f' && xz - -9 `basename '%f' .bz2'` (bunzip to the tar file and compress tarfile to xz)