Skip to content

Instantly share code, notes, and snippets.

@martinbpeters
Created November 26, 2010 10:17
Show Gist options
  • Save martinbpeters/716519 to your computer and use it in GitHub Desktop.
Save martinbpeters/716519 to your computer and use it in GitHub Desktop.
Calculate a percentage using shell
#!/bin/sh
#
# Calculates a percentage
#
echo "scale=3; $1 / $2 * 100" | bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment