Last active
April 9, 2026 03:56
-
-
Save dewomser/5fecba0fcb82ba08443495e9ded45d70 to your computer and use it in GitHub Desktop.
How many astronauts in space ? Bash 1-liner
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/bash | |
| #curl -ks http://api.open-notify.org/astros.json|jq '[.[] ] | .[-2]' | |
| #Toot to Mastodon | |
| a=$(curl -ks http://api.open-notify.org/astros.json|jq '[.[] ] | .[-2]') | |
| d=$(date) | |
| echo -e "Heute am $d sind $a Astronauten im Weltall\n Und hier gibts das Skript https://gist.github.com/dewomser/5fecba0fcb82ba08443495e9ded45d70" | toot post |
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/bash | |
| #spacemen's names and stations | |
| a=$(curl -ks http://api.open-notify.org/astros.json) | |
| b="$(echo $a|jq '.people[] | [.craft, .name] | @csv' | tr -d '"' | tr -d '\' )" | |
| echo -e "Im Weltraum sind:\n$b\nQuelle: https://gist.github.com/dewomser/5fecba0fcb82ba08443495e9ded45d70 " |toot post |
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/bash | |
| #spacemen's names and stations | |
| a=$(curl -ks http://api.open-notify.org/astros.json) | |
| b=$(echo $a|jq '.people[] | [.craft, .name] | @csv' | tr -d '"', | tr \\ \|) | |
| echo Am $(date +%d.%m.%y_%H:%M)' sind gerade im Weltraum:' $'\n''|Raumschiff||Astronaut|'$'\n'"$b"| toot post |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment