Skip to content

Instantly share code, notes, and snippets.

@cyberfox
Created June 28, 2009 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberfox/137231 to your computer and use it in GitHub Desktop.
Save cyberfox/137231 to your computer and use it in GitHub Desktop.
A cool little, super-simple, shell script for doing calculations.
# Tried to twitter this; FAIL.
$ cat > calc
#!/bin/env ruby
p eval(ARGV[0])
^D
$ chmod a+x calc
$ ./calc 4*Math::PI
$ ./calc "Math::sqrt(15241578750190521)"
$ ./calc 24*7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment