Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active April 9, 2026 03:56
Show Gist options
  • Select an option

  • Save dewomser/5fecba0fcb82ba08443495e9ded45d70 to your computer and use it in GitHub Desktop.

Select an option

Save dewomser/5fecba0fcb82ba08443495e9ded45d70 to your computer and use it in GitHub Desktop.
How many astronauts in space ? Bash 1-liner
#!/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
#!/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
#!/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