First bash script for Raspberry pi

Hi,

I'm trying to get the configuration just as I'd like. But I can't get it to work?
I try to read if: xset s off xset -dpms xset s noblank
Is already in the .xinitrc file.... but it doesn't seem to work. I need it to check if it is already in the file otherwise it should echo that it's already in.

#!/bin/bash
if [[ read = "xset s off xset -dpms xset s noblank" /home/pi/.xinitrc ]]; then
    echo "xset is already configured";
else 
    echo >> /home/pi/.xinitrc "xset s off xset -dpms xset s noblank";
fi
echo >> /home/pi/.bashrc "export DISPLAY=:0
chromium-browser --kiosk https://google.com";

Not sure I understand your logics. Please be aware that read is a bash builtin (command) and should not be used as a variable nor compared to anything like you do in above. You can use its exit code, though.
Did you consider the grep command?

I'd like it to read what is in the .xinitrc file. If there is nothing then

echo xset s off xset -dpms xset s noblank >> into .xinitrc
else echo "do nothing"

Is it possible that it checks the file for containing the

xset s off xset -dpms xset s noblank

information in it?