You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

calc 204B

12345678910
  1. #!/usr/bin/env sh
  2. #
  3. # pbrisbin 2013 - perform simple math via bc or awk.
  4. #
  5. ###
  6. if which bc &>/dev/null; then
  7. printf "scale=10; %s\n" "$*" | bc -l
  8. else
  9. printf "BEGIN { print %s }\n" "$*" | awk -f -
  10. fi