Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Created June 15, 2022 20:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thcipriani/915b47d59308db2bd9ea8a70e6719b1c to your computer and use it in GitHub Desktop.
Save thcipriani/915b47d59308db2bd9ea8a70e6719b1c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
printf '%s°C\n' "$(units "tempF($@)" 'tempC' | xargs)"
printf '%s°F\n' "$(units "tempC($@)" 'tempF' | xargs)"
@brandonpittman
Copy link

It should be noted that this doesn't work with macOS' built-in units. It will work with gnu-units though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment