The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
if command not having the right output
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
if command not having the right output
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
05-22-2007
lorcan
Registered User
Join Date: May 2007
Posts: 217
#!/bin/sh
LOG_FILE=log.txt
grep -l fail /var/log/messages* > $LOG_FILE
if [$? -eq 0]
then
echo "Bad"
echo "Files that contains failures are"
cat $LOG_FILE
else
echo "Good"
fi
exit
lorcan
View Public Profile
Find all posts by lorcan