if [-z"$2"]; then
    echo "error pattern not enterd please provide a pattern"
    exit 1
    
if [-z"$2"]; then
    echo "error file not enterd please provided a file"
    exit 2
fi
pattern="$1"
file="$2"

result=$(grep -o-i"$pattern,$file")
if [-z"$result"]; then
    echo "pattern '$patern'not found in the file'$file'"
    
else 
    echo "occurance of pattern'$pattern'in file '$file'"
    echo "$result"
fi

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: