Skip to content

Instantly share code, notes, and snippets.

View m-r-r's full-sized avatar

Mickaël RAYBAUD-ROIG m-r-r

View GitHub Profile
@m-r-r
m-r-r / math.fish
Last active August 29, 2015 14:06
A Fish function for doing floating points calculations
function math --description 'Perform math calculations in bc'
if count $argv > /dev/null
switch $argv[1]
case -h --h --he --hel --help
__fish_print_help math
return 0
end
set -lx LC_NUMERIC C
set -lx BC_LINE_LENGTH 0
set -l out (echo $argv | bc)