From 020605c420a62e47ebcb3b2343c07bf7b6034f64 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 23 Jan 2016 01:40:10 +0100 Subject: [PATCH] Work with non GNU xargs too --- mapper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mapper.sh b/mapper.sh index 5a87418..6a99168 100755 --- a/mapper.sh +++ b/mapper.sh @@ -73,12 +73,12 @@ do posx=$(($spawnx+$tilesize*($x-$tilenum/2))) posy=$(($spawny+$tilesize*($tilenum/2-$y))) # Execute sh -c "something" - echo "-c" - echo "$prefix_pipefail ; $mapperpath ${MAPPERPARAMS} -i ${MAPDIR} --geometry ${posx},${posy}+${tilesize}+${tilesize} -o ${tiledir}/20/map_${x}_${y}.png \ + printf "%s\x00" "-c" + printf "$prefix_pipefail ; $mapperpath ${MAPPERPARAMS} -i ${MAPDIR} --geometry ${posx},${posy}+${tilesize}+${tilesize} -o ${tiledir}/20/map_${x}_${y}.png \ 2> >(>&2 prefix '[TILEGEN 20/map_${x}_${y}.png ERR]: ') | prefix '[TILEGEN 20/map_${x}_${y}.png]: ' \ - || (>&2 echo 'minetesmapper for tile [${x},${y}] ended with non zero exit code'; exit 255)" + || (>&2 echo 'minetesmapper for tile [${x},${y}] ended with non zero exit code'; exit 255)\x00" done -done | xargs -n2 $jobparam -d '\n' bash # bash required because of "set -o pipefail" usage +done | xargs -n2 $jobparam -0 bash # bash required because of "set -o pipefail" usage xargs_exit=$? if [ $xargs_exit -ne 0 ]; then