Changeset 2631 in /cluster/svnroot


Ignore:
Timestamp:
Sep 13, 2010 10:38:18 PM (10 years ago)
Author:
skylar
Message:

splitting apart hex and dec conversions (#528)

Location:
bccd-ng/branches/skylar-test_fw/trees/KNOPPIX/boot/isolinux/minirt
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-test_fw/trees/KNOPPIX/boot/isolinux/minirt/convert_0x2b

    r2630 r2631  
    2424fi
    2525
    26 DEC_NUM=$(printf "%d" ${HEX_NUM})
    27 
    28 QUOTIENT=${DEC_NUM}
    29 declare -a MODS
    30 MODS[${#MODS[*]}]=$((${QUOTIENT} % 2))
    31 while test ${QUOTIENT} -ne 0; do
    32     QUOTIENT=$((${QUOTIENT} / 2))
    33     MODS[${#MODS[*]}]=$((${QUOTIENT} % 2))
    34 done
    35 
    36 
    37 for((i=${#MODS[*]};i>=0;i--)); do
    38     STRING=${STRING}${MODS[${i}]}
    39 done
    40 
    41 STRING=$(echo ${STRING}|sed -e 's!^[[:digit:]]\([[:digit:]{4}]\)!\1!g')
    42 
    43 printf "%04d" ${STRING}
     26./convert_dec2b -n $(printf "%d" ${HEX_NUM})
Note: See TracChangeset for help on using the changeset viewer.