func runCommand(command string) (commandExitStatus int, commandOutput []byte, err error) {
	program := "/bin/bash"
	args := []string{"-c", command}
	cmd := exec.Command(program, args...)
	commandOutput, err = cmd.CombinedOutput()
	var waitStatus syscall.WaitStatus
	if err != nil {
		if exitError, ok := err.(*exec.ExitError); ok {
			waitStatus = exitError.Sys().(syscall.WaitStatus)
			log.Printf("command exit code = <%d>", waitStatus.ExitStatus())
		}
		log.Printf("error <%v> at cmd.CombinedOutput()", err)
		log.Printf("command (not successful) = <%s>", strings.Join(cmd.Args, " "))
		if len(commandOutput) > 0 {
			log.Printf("command output (stdout, stderr) =\n%s", string(commandOutput))
		}
	} else {
		waitStatus = cmd.ProcessState.Sys().(syscall.WaitStatus)
	}
	commandExitStatus = waitStatus.ExitStatus()
	return
}
/*
runCommand runs a command / program
package main
import (
	"bufio"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
	"syscall"
	pip "github.com/JamesMilnerUK/pip-go"
	"github.com/printmaps/printmaps/pd"
)
func createMapOrder(pmData pd.PrintmapsData) error {
	file := filepath.Join(pd.PathWorkdir, pd.PathOrders, pmData.Data.ID) + ".json"
	if _, err := os.Stat(pd.PathOrders); os.IsNotExist(err) {
		if err := os.MkdirAll(pd.PathOrders, 0755); err != nil {
			log.Printf("error <%v> at os.MkdirAll(), path = <%s>", err, pd.PathOrders)
			return err
		}
	}
	data, err := json.MarshalIndent(pmData, pd.IndentPrefix, pd.IndexString)
	if err != nil {
		log.Printf("error <%v> at json.MarshalIndent()", err)
		return err
	}
	return ioutil.WriteFile(file, data, 0666)
}
func readPolyfile(filename string, pPolygon *pip.Polygon) error {
	var lon float64
	var lat float64
	var pP pip.Point
	lines, err := slurpFile(filename)
	if err != nil {
		log.Printf("error <%v> at slurpTextfile(), file = <%v>", err, filename)
		return err
	}
	for index, line := range lines {
		if index > 1 {
			if strings.TrimSpace(line) == "END" {
				break
			}
			_, err := fmt.Sscanf(line, "%f%f", &lon, &lat)
			if err != nil {
				log.Printf("error <%v> at fmt.Sscanf(), file = <%s>, line = <%s>", err, filename, line)
				return err
			}
			pP.X = lon
			pP.Y = lat
			pPolygon.Points = append(pPolygon.Points, pP)
		}
	}
	return nil
}
func slurpFile(filename string) ([]string, error) {
	var lines []string
	file, err := os.Open(filename)
	if err != nil {
		return lines, err
	}
	defer file.Close()
	scanner := bufio.NewScanner(file)
	scanner.Split(bufio.ScanLines)
	for scanner.Scan() {
		line := scanner.Text()
		lines = append(lines, line)
	}
	return lines, nil
}
func readCapafile(filename string, pmFeature *PrintmapsFeature) error {
	data, err := ioutil.ReadFile(filename)
	if err != nil {
		log.Printf("error <%v> at ioutil.ReadFile(), file = <%s>", err, filename)
		return err
	}
	err = json.Unmarshal(data, pmFeature)
	if err != nil {
		log.Printf("error <%v> at json.Unmarshal()", err)
		return err
	}
	return nil
}