Skip to content

Instantly share code, notes, and snippets.

@rjungemann
Created September 24, 2011 20:11
Show Gist options
  • Save rjungemann/1239798 to your computer and use it in GitHub Desktop.
Save rjungemann/1239798 to your computer and use it in GitHub Desktop.
Math in Bash
expr '1 + 1'
echo $[1 + 1]
let variable=1+1 # spaces are illegal
echo '6 ^ 10' | bc
bc <<< '13 / 5' # use heredoc notation to pass parameters to bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment