2019年11月8日 星期五

34_tail hilght



34_tail hilght

高亮 tail 指令

tail -f xxx.log | perl -pe 's/(ERROR)/\e[1;31m$1\e[0m/g'


H1(){
if [ "$#" -ne 2 ]
then
echo "\$1 關鍵字"
echo "\$2 色碼"
echo "色碼"
return
fi
perl -pe 's/('$1')/\e[1;'$2'm$1\e[0m/g';
}

底線:  4
反白:  7



cat /etc/passwd |  perl -pe 's/(retired gracefully)/\e[1;41m$1\e[0m/g' |\
  perl -pe 's/(deployment)/\e[1;42m$1\e[0m/g'


H1(){ perl -pe 's/('$1')/\e[1;'$2'm$1\e[0m/g'; }
for i in {1..50}
do
echo $i
echo ABCD| H1 BC $i
done

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...