From 200ebe43dcae5c8fd0dba69f9a64565d97fb49ad Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 5 Sep 2006 02:00:23 +1000 Subject: [PATCH] Add math shellscript function, which is a thin wrapper around bc darcs-hash:20060904160023-ac50b-0d784182ca3930b0987d4338655b8717237e842c.gz --- share/functions/math.fish | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 share/functions/math.fish diff --git a/share/functions/math.fish b/share/functions/math.fish new file mode 100644 index 000000000..d28087faf --- /dev/null +++ b/share/functions/math.fish @@ -0,0 +1,15 @@ + +function math -d (N_ "Perform math calculations in bc") + if count $argv >/dev/null + set -l out (echo $argv|bc) + echo $out + switch $out + case 0 + return 1 + end + return 0 + end + return 2 + +end +