
___x_cmd_mawk___cmd(){
    x hascmd mawk || x env try mawk || return
    # shellcheck disable=SC2317
    ___x_cmd_mawk___cmd(){
        ___x_cmd_mawk___command "$@"
    }
    ___x_cmd_mawk___command "$@"
}

# for windows: to address the problem in the windows terminal: no space write in disk
if x os name win:; then
___x_cmd_mawk___command(){
    if [ -t 2 ]; then
        (
            exec 3>&1
            ( command mawk "$@" | ___x_cmd_cmds_cat >&3 ) 2>&1 | ___x_cmd_cmds_cat >&2
        )
    elif [ -t 1 ]; then
        command mawk "$@" | ___x_cmd_cmds_cat
    else
        command mawk "$@"
    fi
}
else
___x_cmd_mawk___command(){
    command mawk "$@"
}
fi
