0

I have a postgreSQL database. I also have a script running that looks for a keyword on website and if the word is found the script will say word found and print out date and time when it was found.

Now the problem I am facing is how to add data from script into my database so I can see how many times the word was found and not found?

Script:

!/bin/bash

        echo "looking for the word Enviro"
               wget -O index.html1 https://www.overstock.com/flash-deals


                   echo "file updated"

if grep -q "Enviro" index.html1;

  then

         echo found the word Enviro > fw.tx

  else

         echo not found the word Enviro > nfw.txt

fi

          echo "timestamp $(date)"
Community
  • 1
  • 1
karkha2894
  • 11
  • 2
  • https://www.postgresql.org/docs/current/static/app-psql.html – Abelisto Jun 28 '17 at 17:37
  • 1
    You should probably show your script. Also see [Add rows into Database table using Shell Script?](https://stackoverflow.com/q/30461210/608639), [Shell script to execute pgsql commands in files](https://stackoverflow.com/q/8594717/608639), [How to get the psql table records in shell script?](https://unix.stackexchange.com/q/266739/56041), etc. – jww Jun 28 '17 at 18:55

0 Answers0