I am writing an If then else script to check if a certain value exists in a file. If the value exists, print value exists, else print value does not exist.
#!/bin/bash #This script will check a file and determine if the QID exists. #search the zero day file for qids and system tracking id's. These are contained in #the file file. echo What is the QID number $HOME? read QID #Set some variables Qualyfile=$(cat /home/dc368/zeroday/zerodayresearch) QualysID=$QID If [ $Qualyfile|grep $QualysID = $QualysID ]; then echo qid exists else echo qid does not exist fi