smithy: get rid of bc dependency

bc is not available by default on some minimal CentOS installations
and VM images, so we'd better avoid using it.

Change-Id: Ib01de0081b47a2b300a5b04a867124bb63917d6d
smithy: shell style improvements

- put variable expansions into quotes where possible;
- fix couple of minor issues.

Change-Id: I56576250f428aee75c3e8d7154b287a080cb596c