title: What does the operator != mean in a shell script?
body: <p>In this i have an exclamation mark in my second if statement why is this used.</p>
  
  <pre><code>#!/bin/bash
  
  name=$1
  if [ "$name" = "" ]
  then echo -n "Enter a name to search for: "
       read name
  fi
  
  grep -i cheryl ~uli101/uli101/phonebook
  grep -i $name ~uli101/uli101/phonebook
  
  if [ "$?" != "0" ]
  then echo -n "Name '$name' not in directory "
  fi
  </code></pre>