samedi 20 juin 2020

How can I print all the results of if loops at the end of shell script for a better view

For instance, I have 2 if loops as below. I want to print the output when the script executed as well as it has to be printed at the end of script to combine all the results that filed. So I need the output to print only the 'else' statement at the end of the output line by line. Is it possible, please provide your inputs.

  • If loop 1:

if [ "$Core" -eq 0 ] && [ "$Zombie" -eq 0 ] then echo "there are no core/zombie files Server seems to be fine" else echo "Found core/zombile files, please investigate ASAP" fi

#
  • if loop 2

if [ $CORBA_WC -eq 0 ] then echo "Ther are NO 'CORBA.INTERNAL' error found in the logs" else echo "We can see 'CORBA.INTERNAL' error in the below file(s), please check if these are recent files: " echo "$CORBA" fi echo

Aucun commentaire:

Enregistrer un commentaire