Skip to content
Snippets Groups Projects
Commit 77899abc authored by sak2n21's avatar sak2n21
Browse files

(Commit Message) Script file for grep data

parent e9447e14
Branches
No related tags found
No related merge requests found
data.sh 0 → 100755
#!/bin/bash
curl https://www.kitco.com/charts/livegold.html > data.html
goldprice=$(cat data.html | grep "sp-bid" | sed 's/[^$.0-9]*//g')
curl https://www.kitco.com/charts/livesilver.html > data2.html
silverprice=$(cat data2.html | grep "sp-bid" | sed 's/[^$.0-9]*//g')
curl https://www.kitco.com/charts/livepalladium.html > data3.html
palladiumprice=$(cat data3.html | grep "sp-bid" | sed 's/[^$.0-9]*//g')
curl https://www.kitco.com/charts/liveplatinum.html > data4.html
platinumprice=$(cat data4.html | grep "sp-bid" | sed 's/[^$.0-9]*//g')
date=$(date +%d-%m-%Y)
time=$(date "+%H-%M %p")
echo "GoldPrice:$goldprice, SilverPrice:$silverprice, PalladiumPrice:$palladiumprice, PlatinumPrice:$platinumprice, DateTime: $date $time" >>data.txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment