slitaz-base-files rev 102
Add: calc - Small AWK calculator
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Mar 07 10:53:49 2012 +0100 (2012-03-07) |
parents | 8f45abb77dc5 |
children | 4a0b818014d8 |
files | rootfs/usr/bin/calc |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/rootfs/usr/bin/calc Wed Mar 07 10:53:49 2012 +0100 1.3 @@ -0,0 +1,15 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# Small cmdline AWK calculator. 1.7 +# Copyright (C) 2012 SliTaz GNU/Linux. 1.8 +# 1.9 + 1.10 +case "$1" in 1.11 + *[0-9]*) 1.12 + awk "BEGIN{ print $* }" ;; 1.13 + *) 1.14 + name=$(basename $0) 1.15 + echo -e "\nUsage: $name [0-9][+-*/][0-9]" 1.16 + echo -e "Example: $name 36*12\n" ;; 1.17 +esac 1.18 +exit 0