The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-21-2009
aoussenko aoussenko is offline
Registered User
  
 

Join Date: May 2008
Posts: 119
how to use "if not" construction

Hi
I am working in ksh and need to turn the following "if" statement into "if not" :

if psef op | grep -w fps1 >/dev/null
echo fps1 is running.
else
exit 1
fi

I am getting syntax errors no matter what I do, for example :

n079$ if [[ ! psef op | grep -w fps1 | grep -v grep > /dev/null ]]; then
ksh: syntax error: `op' unexpected

any idea? Thakns a lot for help -A