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

Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

705


How will you pass and access arguments to a script in linux?

590


Why are shell scripts used?

626


How do you create a shortcut in linux?

597


What is difference between bash and shell?

558






How do I run a powershell script?

578


Is shell scripting a language?

587


Why is used in shell scripting?

562


What does the sh command do?

610


How to check if a directory exists?

560


Is shell a part of kernel?

561


Is powershell a bash?

590


What are scripts in psychology?

601


How will you print the login names of all users on a system?

577


Is shell scripting difficult?

559