#!/bin/bash if grep -xq "LINE_TO_BE_MATCHED" FILE_TO_LOOK_IN ; then # code for if it exists else # code for if it does not exist fi