[ILUG] what does this shell script mean

From: hrishy samant (hrishys at domain yahoo.co.uk)
Date: Wed 09 May 2001 - 09:27:21 IST


hello

could anybody explain me this shell script

LEVEL=0
 
function set_level
{
 if [ $LEVEL -ne 0 ]
 then
  if [ $LEVEL -ne $1 ]
  then
   echo "Error in determining level of driver!"
   exit 0
  fi
 fi
 LEVEL=$1
}
 
cat dbs.log
grep "Level 1 driver function settings" dbs.log > null
&& set_level 1
 
# level-2 has larger queries...
grep "allocate_sql_buffer_area size 16000" dbs.log >
null && set_level 2

if [ $LEVEL -eq 0 ]
then
 echo "warning: level of driver not determined;
defaulting to level 1"
 LEVEL=1
fi
exit $LEVEL

can anybody explain what this &&set_level 1 means

____________________________________________________________
Do You Yahoo!?
Get your free at domain yahoo.co.uk address at http://mail.yahoo.co.uk
or your free at domain yahoo.ie address at http://mail.yahoo.ie



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:14 GMT