Last active
October 24, 2024 04:00
-
-
Save dewomser/37bee8b04be32a985489ee65cbdadd30 to your computer and use it in GitHub Desktop.
Get temperature from an API. Decide if hot or cold. A very short Bashscript
This file contains 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/bash | |
t=$(curl -s https://wetter.hs-worms.de/api/v3/data | jq '.temperature.out') | |
t1=15 | |
a=$(echo "$t<$t1"|bc) | |
#testa failed =$(( t<t1 )) | |
if [[ $a -eq 1 ]]; then | |
echo "Uh, this is cold !" | |
else | |
echo "Uff,rather warm !" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dieses Script ist Teil meines Vortrags gewesen. API
https://www.untergang.de/index.php/konferenzen-thema-linux/lpd-23-1-in-worms.html