h8rt3rmin8r

droot

Dec 30th, 2018
170
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. #
  3. #   DIGITAL ROOT CONVERSION SCRIPT - (droot.sh)
  4. #   Created by h8rt3rmin8r on 20181231
  5. #   Source code: https://pastebin.com/raw/LcK5etiz
  6. #
  7.  
  8. # Variable declarations
  9. LIST_A=""; LIST_B=""
  10.  
  11. # Function declarations
  12. function numredux_var() {
  13.     REDUX_MOD=""; REDUX_VAR="$1"
  14.     if [[ "$(echo ${REDUX_VAR} | wc -c)" -ge 21 ]];
  15.     then
  16.         REDUX_MOD=$(echo $REDUX_VAR | sed 's/.\{1\}/& /g' | sed 's/ /+/g' | rev | cut -c 2- | rev | bc)
  17.         numredux_var "${REDUX_MOD}"
  18.         return
  19.     else
  20.         while [ $REDUX_VAR -gt 9 ]
  21.         do
  22.             REDUX_MOD=$(echo $REDUX_VAR | sed 's/.\{1\}/& /g' | sed 's/ /+/g' | rev | cut -c 2- | rev | bc)
  23.             REDUX_VAR="$REDUX_MOD"
  24.             if [[ "${REDUX_VAR}" == 1 ]]; then break; fi
  25.         done
  26.     fi
  27.     echo ${REDUX_VAR}; return
  28. }
  29.  
  30. # Input filtering and core process execution
  31. if [[ "$1" =~ ^-?[0-9]+$ ]];
  32.     then numredux_var "$1"; exit 0
  33.     else echo "ERROR: You must pass a NUMERIC input."; exit 1
  34. fi
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×