i have a nested if statement that will keep inserting the string into the file I want the if statement to see that it is true then do nothing else if string is not there then insert. So when i runs the next time if its true do nothing here is my if statement:
if grep -q "PATH=$PATH:$HOME/bin' "root/.bashrc"
echo "The executable search path PATH does exist"
if ! grep -q "PATH=$PATH:$HOME/bin' "root/.bashrc"
echo "Root search path is missing will be inserted"
sed -i -e '3a\
\#User blah blah blah' "/root/.bashrc"
sed -i -e '4a\
PATH=blah blah blah' "/root/.bashrc"