#!/bin/bash
set +x

if [ $# -ne 3 ]; then
    exit 1
fi

source /opt/huawei/snas/script/inspect_mml/CommonFunc.sh
if [ ! -d /tmp/ ];then
    mkdir -p /tmp/
fi
> /tmp/tmpfilemmlresult$$
/opt/huawei/snas/script/inspect_mml/ShowInspectMml2 "$1" "$2" "$3" >> /tmp/tmpfilemmlresult$$
sed -i -e 's/\x1B\[0;[3-4][0-9]m//g' -e 's/\x0D//g' -e 's/\x00//g' /tmp/tmpfilemmlresult$$ 2>&1
tmp=""
tmp=$(cat /tmp/tmpfilemmlresult$$ |grep -Po "/tmp/snas_debug[0-9]*")
if [ "${tmp}_X" = "_X" ]; then
    mmlresultfile="/tmp/tmpfilemmlresult$$"
else
    mmlresultfile="${tmp}"
fi

cat "${mmlresultfile}"
rm -rf /tmp/tmpfilemmlresult$$