Skip to content

Instantly share code, notes, and snippets.

@rxmmah
Created May 20, 2024 21:30
Show Gist options
  • Save rxmmah/ff817db3b00770174d41e428527dcdf7 to your computer and use it in GitHub Desktop.
Save rxmmah/ff817db3b00770174d41e428527dcdf7 to your computer and use it in GitHub Desktop.
A Shell script to fetch and display bitcoin price
#!/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