Como resultado de un bash script tengo esta parte final de codigo que me genera un archivo HTML a partir de un archivo de texto. Requiero cambiar a color ROJO ciertas de sus líneaslineas para poderlas diferenciar más fácilmentemas facilmente.
cat last_file.txt last_file_*.txt > Final_output.txt
if [ $(grep -c "about" Final_output.txt) -gt 0 ]
then
awk -F' : ' '
BEGIN{
print "<html><style type=\"text/css\">table, th, td {border: 1px solid black;}</style><body><table><th>ENVIRONMENT CERTIFICATES</th>"
}
{
print "<tr>"
for(i=1;i<=NF;i++)
print "<td>" $i "</td>"
print "</tr>"
}
END{
print "</table></body></html>"
}
' Final_output.txt > Certificates_$current_date.html
echo -e "Please check the attachment and output below to verify certificates that will expire within 30 days\n\n $(cat \Final_output.txt)" | mailx -a Certificates_$current_date.html -s "ENVIRONMENT CERTIFICATES, Certificates Expiring Soon" [email protected]
else
echo "There is no current SSL certificates that will expire within next 30 days. " |mailx -s "SSL CERTIFICATES REMAIN VALID" [email protected]
cat last_file.txt last_file_*.txt > Final_output.txt
if [ $(grep -c "about" Final_output.txt) -gt 0 ]
then
awk -F' : ' '
BEGIN{
print "<html><style type=\"text/css\">table, th, td {border: 1px solid black;}</style><body><table><th>ENVIRONMENT CERTIFICATES</th>"
}
{
print "<tr>"
for(i=1;i<=NF;i++)
print "<td>" $i "</td>"
print "</tr>"
}
END{
print "</table></body></html>"
}
' Final_output.txt > Certificates_$current_date.html
echo -e "Please check the attachment and output below to verify certificates that will expire within 30 days\n\n $(cat \Final_output.txt)" | mailx -a Certificates_$current_date.html -s "ENVIRONMENT CERTIFICATES, Certificates Expiring Soon" [email protected] else echo "There is no current SSL certificates that will expire within next 30 days. " |mailx -s "SSL CERTIFICATES REMAIN VALID" [email protected]
Adjunto Archivo de salida. deseo cambiar las lineas que contienen la palabra "about" a color ROJO.