сам скрипт «tag»
#!/bin/sh
#
#TAG=ttt
TAG=$1
if [ -z "$1" ] ;then
echo "Error: \"\$TAG\" is empty"
echo "Usage: ./tag TAG_NAME" && exit
fi
ALL=`find /var/log/packages| wc -l`
if [ "$ALL" = 0 ] ;then
echo "Error: \"\$ALL\" is empty"
echo "Resume: не Слака " && exit
fi
MY=`find /var/log/packages| grep $TAG | wc -l`
if [ "$MY" = 0 ] ;then
echo "Error: \"\$MY\" is empty"
echo "Resume: не Слакварщик " && exit
fi
echo $((100*$MY/$ALL))"%"
FULL=79
NUM=`echo $(($FULL*$MY/$ALL))`
for ((a=0;a<=$FULL;a++));do
printf \|
done
echo ""
printf 8
for ((b=1;b<=`echo $(($NUM-1))`;b++));do
printf \=
done
printf \>
echo ""
__________________________________________________________
Мой вывод
27% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 8====================>