if echo $LOGFILENAME | grep -qE "*.gz"
then
GUNZIP="gunzip"
else
GUNZIP="grep -a \n"
fi
$LOGFILENAME
是字符串
如果字符串包含.gz
则 GUNZIP
变量是gunzip
,否则 GUNZIP
是grep -a \n
if echo $LOGFILENAME | grep -qE "*.gz"
then
GUNZIP="gunzip"
else
GUNZIP="grep -a \n"
fi
$LOGFILENAME
是字符串
如果字符串包含.gz
则 GUNZIP
变量是gunzip
,否则 GUNZIP
是grep -a \n