This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
user:vcordes1:portfolio:con [2011/12/08 21:20] – created vcordes1 | user:vcordes1:portfolio:con [2011/12/15 17:35] (current) – vcordes1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Purpose===== | ||
+ | * To create a number system converter that will process ridiculous numbers via bash | ||
+ | =====Procedure and Necessary Knowledge===== | ||
+ | * Scripting and debugging | ||
+ | |||
+ | =====Miscellaneous====== | ||
+ | * This will only work up to base 10 | ||
+ | * I don't remember how many digits or what number it will properly process...it is however a lot | ||
+ | =====The Script===== | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | a=0 | ||
+ | echo -n " | ||
+ | read base | ||
+ | echo -n " | ||
+ | read number | ||
+ | until [ $number -eq 0 ]; do | ||
+ | n=0 | ||
+ | until [ `echo " | ||
+ | let n=$n+1 | ||
+ | done | ||
+ | let n=$n-1 | ||
+ | let number=$number-`echo " | ||
+ | places="" | ||
+ | for((i=0; | ||
+ | places=" | ||
+ | done | ||
+ | places=" | ||
+ | a=`echo " | ||
+ | done | ||
+ | echo "The value in base $base is: $a" | ||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | |||
+ | =====Attributes===== | ||
+ | * Scripting | ||
+ | * Commands | ||
+ | * The UNIX Shell | ||
+ | * The UNIX development environment | ||
+ | * Text Processing |