Need Help!!!!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Help!!!!!
# 1  
Old 06-30-2008
Need Help!!!!!

Hey all,
I am trying to to attempt the following.
I need to check driver information within log files to make sure that all of the machines that the logs come from are up to date.
I am basically calling the filenames from the db, then unzipping just the logfile from each and grepping for a specific ver#. If it doesnt match it should email me with info that I need.

I cannot figure out how to unzip each package 1 at a time and grep for the version number. Please see my code and let me know what I might be doing wrong (outside of trying to take this project on). Thanks in advance:



if [ -f /tmp/out ]
then
mv /tmp/out /tmp/checkforgf >/dev/null 2>&1

#unzip -l /tmp/checkforgf | grep -i wowly.log>/dev/null 2>&1
unzip /tmp/checkforgf wowly.log
grep -i PDD-1.1-20080424151646 /tmp/goldfinch.log>/dev/null 2>&1
if [ ! $? = 0 ]
then
echo $apptid >> /tmp/mySessions.txt
fi
fi

It doesnt work right:

Archive: /tmp/checkforgf
inflating: goldfinch.log
Archive: /tmp/checkforgf

replace *.log? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [ ]
replace *.log? [y]es, [n]o, [A]ll, [N]one, [r]ename: error: invalid response [2]

Any suggesstions?
# 2  
Old 06-30-2008
man zgrep or grep -Z
Code:
....
zgrep -i PDD-1.1-2008044151646 /tmp/goldfinch >/dev/null 
if [ ! $? = 0 ]
.......

# 3  
Old 06-30-2008
grep and zgrep also support the -q option == quiet mode. No output just a return value.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question