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 does $$ mean in shell script?

584


What exactly is a shell?

604


How important is shell scripting?

543


Why should we use shell scripts?

590


What is the difference between bash and shell?

641






How to debug the problems encountered in the shell script/program?

627


Why is a script important?

562


What is @echo off?

566


What is the use of echo in shell script?

543


Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?

1716


What is bash eval?

548


What is bash shell command?

560


What happens on a system call?

559


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

1708


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

636