

___x_cmd_pldg___exec(){ (
    [ -n "$tracemode" ] || {
        ___x_cmd_hascmd pledge || ___x_cmd cosmo use pledge
        ___x_cmd_cmds pledge "$@"
        return $?
    }

    ___x_cmd_hascmd strace || N=pldg M='Command not found -> strace. Please install strace. Eg, x i strace' log:ret:1

    local tmpfile="$tracemode"

    [ "$tracemode" != "-" ] || {
        tmpfile="$___X_CMD_ROOT_TMP/mac/sb/tmpfile.$$"
    }

    pldg:debug "Writing strace output to -> $tmpfile"
    ___x_cmd ensurefp "$tmpfile"

    ___x_cmd_hascmd pledge || ___x_cmd cosmo use pledge

    ___x_cmd ensurefp "$tmpfile"
    ___x_cmd_cmds strace -f --output "$tmpfile" -- pledge "$@"

    local errcode=$?

    [ "$tracemode" != "-" ] || {
        printf "\n\n%s\n"       "----------------------"
        ___x_cmd_cmds cat "$tmpfile">&2
        printf "\n%s\n\n"       "----------------------"
        ___x_cmd rmrf "$tmpfile"
    }

    return $errcode
) }

