Write a shell script to looking at the log file to see if
the test has passed or not

Answer Posted / kirtiranjan sahoo

test -f $(find /var/log/messages -name "file.log" )
echo $?
If it returns 0 means passed
if 1 means not passed

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the significance of $#?

774


Why do we write bin bash in shell scripts?

707


What are the two files of crontab command?

839


What is a shell in operating system?

764


How to get the last line from a file using just the terminal?

887


What is shell application?

727


How to get script name inside a script?

742


What is sh in shell script?

733


What is eval in shell script?

878


What can scripts do?

825


State the advantages of shell scripting?

795


What is shell scripting used for?

746


How do we delete all blank lines in a file?

775


Write down the syntax for all the loops in shell scripting.

858


What is the use of "$#" in shell scripting?

730