]> git.donarmstrong.com Git - zsh.git/blob - .zsh/func/baseconv
add ~/.local/bin to PATH
[zsh.git] / .zsh / func / baseconv
1 #!/bin/zsh
2 #
3 # func/baseconv
4 #
5 # zsh-based conversion between numeric bases
6 #
7 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
8 # Released under the terms of the Artistic Licence 2.0
9 #
10 # Source repository: git://git.madduck.net/etc/zsh.git
11 #
12
13 if [ $# -ne 3 ]; then
14   echo Usage: ${0##*/} ibase obase number
15   return 1
16 fi
17
18 typeset -li $2 var
19 eval ((var=${1}#${3}))
20 echo ${var#*\#}