Created
May 20, 2024 21:30
-
-
Save rxmmah/ff817db3b00770174d41e428527dcdf7 to your computer and use it in GitHub Desktop.
A Shell script to fetch and display bitcoin price
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
#A Shell script to fetch bitcoin price and display ! | |
#Author: Rammah Alensari | |
#Dependencies | |
# - jq https://stedolan.github.io/jq/ | |
# - Nerd Font https://www.nerdfonts.com/ (or delete the bitcoin iccon) | |
bitcoin_price=$(curl -s https://api.coindesk.com/v1/bpi/currentprice.json | jq -r '.bpi.USD.rate ' | awk -F '.' '{print $1}') | |
echo " ${bitcoin_price}" | cat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment