abclinuxu.cz AbcLinuxu.cz itbiz.cz ITBiz.cz HDmag.cz HDmag.cz abcprace.cz AbcPráce.cz
AbcLinuxu hledá autory!
Inzerujte na AbcPráce.cz od 950 Kč
Rozšířené hledání
×
15.6. 22:44 | Zajímavý článek

Na blogu projektu NeoPG (GitHub), kryptografického softwaru vycházejícího z GnuPG, byly zveřejněny 4 příspěvky detailně popisující aktuální bezpečnostní problémy v GnuPG a souvisejících softwarových produktech. V prvním příspěvku je ukázáno, že je možné vytvořit zprávu, o které budou Earlybird, Evolution, Mutt nebo Outlook tvrdit, že jí dešifrovali a přitom ale zpráva vůbec zašifrována nebyla. V druhém příspěvku je popsána

… více »
Ladislav Hagara | Komentářů: 5
15.6. 13:00 | Komunita

GamingOnLinux informuje, že počítačová hra Track Mania Nations Forever (Steam, Wikipedie) pro Windows je nově dostupná také jako snap. Stejně jako v případě winepaku a Flatpaku se k běhu hry používá překladová vrstva Wine.

Ladislav Hagara | Komentářů: 12
14.6. 15:12 | Komunita

Tradiční setkání příznivců operačního systému Linux pod názvem Linux párty Teplice se bude konat v pátek 15. 6. 2018 v Hospůdce u černé Kočky od 18:00 hodin. Setkají se zde pamětníci příkazové řádky, vítáni jsou však i začínající uživatelé.

František Bublík | Komentářů: 12
14.6. 14:00 | Bezpečnostní upozornění

Intel potvrdil (INTEL-SA-00145) další bezpečnostní chybu ve svých procesorech. Jedná se o chybu CVE-2018-3665 s názvem LazyFP.

Ladislav Hagara | Komentářů: 12
14.6. 11:00 | Nová verze

Spolek OpenAlt zve příznivce otevřených řešení a přístupu na 153. brněnský sraz, který proběhne v pátek 15. června od 18:00 v restauraci U OSLŮ na ulici Sokolská 361/10. Pro zájemce proběhne krátké promítání z výletu do Černobylu.

Ladislav Hagara | Komentářů: 0
13.6. 19:58 | Upozornění

Server lupa.cz rozebírá připravovanou reformu copyrightu v EU a dopad jejího článku 13, který dává internetovým platformám povinnost řešit autorské právo za vlastníky práv, což by v podstatě vedlo k automatizované cenzuře a konci internetu tak, jak ho známe dnes. Podobně v otevřeném dopise varují Vint Cerf, Tim Berners-Lee a jiní odborníci, Cory Doctorow upozorňuje na důsledky pro Wikipedii, nebo github na sdílení kódu.

marbu | Komentářů: 91
12.6. 16:00 | Nová verze

Bylo oznámeno vydání verze 5.13 prostředí KDE Plasma. Přehled nových vlastností i s náhledy v poznámkách k vydání. Videoukázka na YouTube.

Ladislav Hagara | Komentářů: 92
12.6. 11:11 | Zajímavý software

Byla vydána verze 1.8.0 svobodného softwaru Dilay pro 3D modelování technikou digitálního sochání (digital sculpting). Zdrojové kódy jsou k dispozici na GitHubu pod licencí GPLv3. K dispozici je balíček (19,6 MB) ve formátu AppImage. Stačí nastavit právo na spouštění a spustit.

Ladislav Hagara | Komentářů: 10
11.6. 16:55 | Zajímavý projekt

MojeFedora.cz představuje repozitář Flatpaku winepak, který si dává za cíl přinášet do Linuxu aplikace pro Windows v podobě Flatpaku. K běhu aplikací se používá překladová vrstva Wine.

Ladislav Hagara | Komentářů: 27
11.6. 16:33 | Komunita

V rámci letních slev na GOG.com lze do středy 13. června do 15:00 získat počítačovou hru Ziggurat (Wikipedie) běžící také na Linuxu zdarma a bez DRM.

Ladislav Hagara | Komentářů: 0
Jak čtete delší texty z webových stránek?
 (78%)
 (23%)
 (4%)
 (7%)
 (3%)
 (11%)
Celkem 194 hlasů
 Komentářů: 33, poslední včera 23:59
    Rozcestník

    Když to v bash-i ulítne - výběr komprimační metody

    23.12.2012 14:42 | Přečteno: 994× | Linux | poslední úprava: 27.12.2012 11:52

    Když to bash-i ulítne. Kdo někdy programuje, tak to zná: „jen si tady něco vyzkouším na, to je prkotinka v bash-i na 10 řádků“.
    Jenže ta prkotina dává nějaké informace, které chceme rozvíjet a tak je rozvíjíme, a už při délce 20 řádků začíná být jasné, že zvolený nástroj, tedy bash, není to nejlepší, ale pokračujeme…
    …přece vím(e): „Jo je to naprd, bude to sice trvat 3× déle, ale když už to mám(e), přece nebudeme začínat od začátku“. A najednou tu máme 1500 řádků.
    No a přesně to se mi opět stalo.
    Řešil jsem už po několikáte situaci jakou komprimaci na data zvolit.
    Ve spoustě případů je to fuk, a je to zbytečné to řešit - místa je dosta a je snažší navýšit kapacitu. Někdy to naráží „zlom“ (více disků se tam nevleze a pod…) a když už, tak to udělat pořádně.
    bzip2 -9 je sem-tam horší než bzip2 -5, stane se i, že je gzip na tom lépe než bzip2, záleží na typu dat.
    Takže když to člověk chce pořádně, tak si to zkusí a pak to aplikuje, ale ono je to docela opruz. Tak jsem si říkal, že bych si mohl udělat takový testík, který to zkusí a vyhodnotí (hlavně druhá část byla velká chyba, na to je přece tabulkový procesor).
    Řešil jsem už v zásadě 3 situace:
    1. All-in-one co nejmenší. Normální archiv či záloha maximálně zkomprimovaná.
    2. Jednotlivé soubory, každý komprimovaný zvlášť (stejným typem komprese). Konkrétní případ nebudu popisovat, ale lze to přirovnat k úložišti RAW-ů (fotek), kde jsou vygenerované náhledy a je jich smečka. Každý zvlášť chceme proto, že jej chceme rychle získat, nejen rozbalit, ale i přenést.
    3. Jednotlivé složky obsahující roj dat, každá komprimovaná zvlášť. Co složka to zakázka s velkým objemem různých dat, po určité době není třeba mít data ihned po ruce, ale běžně dostupné. Jejich komprimace + přenastavení práv archivu, hezky řeší situaci, rychle a kompaktně lze data získat a zabírají méně místa.
    No jak šel čas, tak mi z toho vylezl tento „skriptík“, jistě obsahující spoustu chyb, někté označené jako vlastnost.

    comptest.bash: (spouštění na vlastní nebezpečí)
    (Doplněný lrzip, rzip a volba 'allbest1' tj. gz -9, bz2 -9, 7z, lrzip -L 9, rzip -9. - rzip, lrzip a 7zip musí být nainstalován gz a bz2 asi je by default)
    #!/bin/bash
    
    #comprimation methods/commands
    #for CMDA[] eval is used
    TXTA=()
    CMDA=()
    EXTA=()
    
    #bzip2 and gzip
    TXTA+=( 'gz -9' )
    EXTA+=( '.gz' )
    CMDA+=( "gzip -9 '[file]'" )
    
    TXTA+=( 'bz2 -9' )
    EXTA+=( '.bz2' )
    CMDA+=( "bzip2 -9 '[file]'" )
    
    TXTA+=( 'gz.bz2 -9 -9' )
    EXTA+=( '.gz.bz2' )
    CMDA+=( "gzip -9 -c '[file]'  | bzip2 -9 > '[file]${EXTA[2]}'" )
    
    TXTA+=( 'bz2.gz -9 -9' )
    EXTA+=( '.bz2.gz' )
    CMDA+=( "bzip2 -9 -c '[file]' | gzip  -9 > '[file]${EXTA[3]}'" )
    
    #7zip
    TXTA+=( '7z' )
    EXTA+=( '.7z' )
    CMDA+=( "7z a -bd '[file]${EXTA[4]}' '[file]'" )
    
    TXTA+=( '7z.gz -txz -9' )
    EXTA+=( '.7z.gz' )
    CMDA+=( "7z a -bd -an -txz -so '[file]' | gzip  -9 > '[file]${EXTA[5]}'" )
    
    TXTA+=( '7z.bz2 -txz -9' )
    EXTA+=( '.7z.bz2' )
    CMDA+=( "7z a -bd -an -txz -so '[file]' | bzip2 -9 > '[file]${EXTA[6]}'" )
    
    TXTA+=( 'gz.7z -txz -9' )
    EXTA+=( '.gz.7z' )
    CMDA+=( "gzip -9 -c '[file]' | 7z a -bd -txz -si '[file]${EXTA[7]}'" )
    
    TXTA+=( 'bz2.7z -9 -txz' )
    EXTA+=( '.bz2.7z' )
    CMDA+=( "bzip2 -9 -c '[file]' | 7z a -bd -txz -si '[file]${EXTA[8]}'" )
    
    TXTA+=( '7z.gz.bz2 -txz -9 -9' )
    EXTA+=( '.7z.gz.bz2' )
    CMDA+=( "7z a -bd -an -txz -so '[file]' | gzip  -9 | bzip2 -9 > '[file]${EXTA[9]}'" )
    
    TXTA+=( '7z.bz2.gz -txz -9 -9' )
    EXTA+=( '.7z.bz2.gz' )
    CMDA+=( "7z a -bd -an -txz -so '[file]' | bzip2 -9 | gzip  -9 >  '[file]${EXTA[10]}'" )
    
    TXTA+=( 'gz.7z.bz2 -9 -txz -9' )
    EXTA+=( '.gz.7z.bz2' )
    CMDA+=( "gzip -9 -c '[file]' | 7z a -bd -an -txz -si -so | bzip2 -9 > '[file]${EXTA[11]}'" )
    
    TXTA+=( 'bz2.7z.gz -9 -txz -9' )
    EXTA+=( '.bz2.7z.gz' )
    CMDA+=( "bzip2 -9 -c '[file]' | 7z a -bd -an -txz -si -so | gzip  -9 >  '[file]${EXTA[12]}'" )
    
    TXTA+=( 'gz.bz2.7z -9 -9 -txz' )
    EXTA+=( '.gz.bz2.7z' )
    CMDA+=( "gzip  -9 -c '[file]' | bzip2 -9 | 7z a -bd -txz -si '[file]${EXTA[13]}'" )
    
    TXTA+=( 'bz2.gz.7z -9 -9 -txz' )
    EXTA+=( '.bz2.gz.7z' )
    CMDA+=( "bzip2 -9 -c '[file]' | gzip  -9 | 7z a -bd -txz -si '[file]${EXTA[14]}'" )
    
    TXTA+=( 'gz -1' )
    EXTA+=( '.1.gz' )
    CMDA+=( "gzip -1 -c '[file]' > '[file].1.gz'" )
    
    TXTA+=( 'bz2 -1' )
    EXTA+=( '.1.bz2' )
    CMDA+=( "bzip2 -1 -c '[file]' > '[file].1.bz2'" )
    
    TXTA+=( 'gz -2' )
    EXTA+=( '.2.gz' )
    CMDA+=( "gzip -2 -c '[file]' > '[file].2.gz'" )
    
    TXTA+=( 'bz2 -2' )
    EXTA+=( '.2.bz2' )
    CMDA+=( "bzip2 -2 -c '[file]' > '[file].2.bz2'" )
    
    TXTA+=( 'gz -3' )
    EXTA+=( '.3.gz' )
    CMDA+=( "gzip -3 -c '[file]' > '[file].3.gz'" )
    
    TXTA+=( 'bz2 -3' )
    EXTA+=( '.3.bz2' )
    CMDA+=( "bzip2 -3 -c '[file]' > '[file].3.bz2'" )
    
    TXTA+=( 'gz -4' )
    EXTA+=( '.4.gz' )
    CMDA+=( "gzip -4 -c '[file]' > '[file].4.gz'" )
    
    TXTA+=( 'bz2 -4' )
    EXTA+=( '.4.bz2' )
    CMDA+=( "bzip2 -4 -c '[file]' > '[file].4.bz2'" )
    
    TXTA+=( 'gz -5' )
    EXTA+=( '.5.gz' )
    CMDA+=( "gzip -5 -c '[file]' > '[file].5.gz'" )
    
    TXTA+=( 'bz2 -5' )
    EXTA+=( '.5.bz2' )
    CMDA+=( "bzip2 -5 -c '[file]' > '[file].5.bz2'" )
    
    TXTA+=( 'gz -6' )
    EXTA+=( '.6.gz' )
    CMDA+=( "gzip -6 -c '[file]' > '[file].6.gz'" )
    
    TXTA+=( 'bz2 -6' )
    EXTA+=( '.6.bz2' )
    CMDA+=( "bzip2 -6 -c '[file]' > '[file].6.bz2'" )
    
    TXTA+=( 'gz -7' )
    EXTA+=( '.7.gz' )
    CMDA+=( "gzip -7 -c '[file]' > '[file].7.gz'" )
    
    TXTA+=( 'bz2 -7' )
    EXTA+=( '.7.bz2' )
    CMDA+=( "bzip2 -7 -c '[file]' > '[file].7.bz2'" )
    
    TXTA+=( 'gz -8' )
    EXTA+=( '.8.gz' )
    CMDA+=( "gzip -8 -c '[file]' > '[file].8.gz'" )
    
    TXTA+=( 'bz2 -8' )
    EXTA+=( '.8.bz2' )
    CMDA+=( "bzip2 -8 -c '[file]' > '[file].8.bz2'" )
    
    TXTA+=( 'lrzip -L 9' )
    EXTA+=( '.lrz' )
    CMDA+=( "lrzip -L 9 '[file]'" )
    
    TXTA+=( 'rzip -9' )
    EXTA+=( '.rz' )
    CMDA+=( "rzip -9 '[file]'" )
    
    
    
    #here you can add item(s) begin
    #  index 33
    
    #here you can add item(s) end
    
    TAR_CMD=( "tar -cf" "tar -rf" )
    
    #default values
    TESTS=( 0 1 2 3 )
    TMP='/tmp'
    TMPDIR='comptest'
    INPUTTYPE="-10"
    VERBOSE=0
    VERBOSE_REPORT=0
    USE_TIME=0
    STOPIT=0
    LEAVE_COMP=0
    SAVE_FILENAME=''
    OPEN_FILENAME=''
    TAR_FILENAME=''
    TAR_TMP_DIR="TAR-TMP-DIR_0123456789QWX_$(date '+%s')"
    
    
    SIZE_OF_BLOCK='4096'
    #do not change ADD_SIZE_TO_BLOCK, it was a good idea but has been forgotten :(
    ADD_SIZE_TO_BLOCK='0'
    REPORT_SPEED_W='0.5'
    REPORT_RATIO_W='0.5'
    REPORT_RATIO_MIN='0.75'
    REPORT_SPEED_MIN='4194304'
    GRAPH_POINT='[letter]'
    GRAPH_POINT_L='0'
    
    
    BCCMD="$( which bc )"
    if [ "$?" -ne "0" ]; then
      echo -e "\n'bc' should be installed\n" >&2
      exit 3
    fi
    
    function waitforkey() {
      if [ "$STOPIT" -eq "1" ]; then
        read -p "Press any key to continue... " -n1 -s
        echo ''
      fi
    }
    
    function waitforkey2() {
      if [ "$STOPIT" -eq "1" ]; then
        read -n1 -s
        echo ''
      fi
    }
    
    #getopt parse  -----------------------
    while getopts ":vmn:t:T:u:hb:fir:R:s:S:cIw:o:e:dLl" opt; do
      case $opt in
        n)
          if [ "$OPTARG" == "gz" ]; then
            TESTS=( 15 17 19 21 23 25 27 29 0 )        
          elif [ "$OPTARG" == "bz2" ]; then
            TESTS=( 16 18 20 22 24 26 28 30 1 )
          elif [ "$OPTARG" == "gzbz2" ]; then
            TESTS=( 15 17 19 21 23 25 27 29 0 16 18 20 22 24 26 28 30 1 )
          elif [ "${OPTARG}" == "allbest1" ]; then
            TESTS=( 0 1 31 32 )
          elif [ "${OPTARG:0:1}" == "e" ]; then
            TESTS=( ${OPTARG:1} ) 
          else
            TESTS=()
            cnt="$((${OPTARG}+1))"
            if [ ${cnt} -gt ${#CMDA[@]} ]; then
              cnt="${#CMDA[@]}"
            fi
            for(( i=0; i < "$cnt"; i++ )); do
              TESTS+=( $i )
            done
          fi 
          if [ ${#TESTS[@]} -lt "1" ]; then
            echo 'Ilegal -n value.' >&2
            exit 1
          fi
          ;;
        t)
          TMP="$OPTARG"
          if [ ! -d ${TMP} ]; then
            echo "-t Temp path '${TMP}' doesn't exist." >&2
            exit 1
          fi
          ;;
        T)
          TMPDIR="$OPTARG"
          ;;
        u)
          TAR_TMP_DIR="$OPTARG"
          ;;
        m)
          USE_TIME=1
          ;;
        v)
          VERBOSE=1       
          ;;
        c)
          GRAPH_POINT="\e[7m[letter]\033[0m"
          GRAPH_POINT_L='12'
          ;;
        b)
          SIZE_OF_BLOCK="$( echo "$OPTARG+0" | $BCCMD )"
          if [ -z "$SIZE_OF_BLOCK" ]; then
            echo "Ilegal -b value." >&2
            exit 1
          fi
          if [ "$SIZE_OF_BLOCK" -lt "1" ]; then
            echo "Ilegal -b value." >&2
            exit 1
          fi
          ;;
        #B)
        #  ADD_SIZE_TO_BLOCK="$( echo "$OPTARG+0" | $BCCMD )"
        #  if [ -z "$ADD_SIZE_TO_BLOCK" ]; then
        #    echo "Ilegal -B value." >&2
        #    exit 1
        #  fi
        #  if [ "$ADD_SIZE_TO_BLOCK" -lt "0" ]; then
        #    echo "Ilegal -B value." >&2
        #    exit 1
        #  fi
        #  ;;
        r) 
          REPORT_RATIO_W="$( echo "x=$OPTARG+0; if(x>0&&x<1) x;" | $BCCMD )"
          if [ -z "$REPORT_RATIO_W" ]; then
            echo 'Ilegal -r value (0<x<1).' >&2
            exit 1
          fi
          ;;
        R)
          REPORT_RATIO_MIN="$( echo "x=$OPTARG+0; if(x>0&&x<1) x;" | $BCCMD )"
          if [ -z "$REPORT_RATIO_MIN" ]; then
            echo 'Ilegal -R value (0<x<1).' >&2
            exit 1
          fi
          ;;
        s) 
          REPORT_SPEED_W="$( echo "x=$OPTARG+0; if(x>0&&x<1) x;" | $BCCMD )"
          if [ -z "$REPORT_SPEED_W" ]; then
            echo 'Ilegal -s value \(0<x<1\).' >&2
            exit 1
          fi
          ;;
        S)
          REPORT_SPEED_MIN="$( echo "x=$OPTARG+0; if(x>1) x;" | $BCCMD )"
          if [ -z "$REPORT_SPEED_MIN" ]; then
            echo 'Ilegal -S value (x>1).' >&2
            exit 1
          fi
          ;;
        i)
          INPUTTYPE="-2"
          break
          ;; 
        f)
          INPUTTYPE="-1"
          shift $(( OPTIND - 1 ))
          break  
          ;;  
        o)
          INPUTTYPE="-3"
          OPEN_FILENAME="$OPTARG"
          if [ ! -f "${OPEN_FILENAME}" ]; then
            echo "Ilegal -o value, file '${OPEN_FILENAME}' doesn't exist." >&2
            exit 1
          fi 
          break
          ;;     
        I)
          STOPIT=1
          ;;
        l)
          LEAVE_COMP=1
          ;;
        L)
          LEAVE_COMP=2
          ;;
        e)
          TAR_FILENAME="$OPTARG"  
          if [ -f "${TAR_FILENAME}" ]; then
            echo "Write report file -w '${TAR_FILENAME}' exists." >&2
          exit
          fi	      
          ;; 
        d) 
          INPUTTYPE="-4"
          break
          ;;
        w)
          SAVE_FILENAME="$OPTARG"
          if [ -f "${SAVE_FILENAME}" ]; then
            echo "Write report file -w '${SAVE_FILENAME}' exists." >&2
    	    exit
          fi	      
          ;;
        h)
          echo 'A small test of comprimation method performance.' 
          echo '  By Igor Mega, ver: 0.12, license: BSD 3-clause'
          echo ' '
          echo " This test create the 'comptest' directory (by default) in /tmp (by default)."
          echo ' All is done in this direcory (before/after a comprim command cd is used).'
          echo " Each tested file is copied (by 'cp') to this directory more times."
          echo ' Only on success all created and copied files in this directory are deleted.'
          echo " The create 'comptest' direcotry is deleted too (if is empty on finish)."
          echo ' WARMING:'
          echo '  If you break this test or an error si reached clean it yourself!'
          echo ' '
          waitforkey
          echo ' comptest.bash [switch] -i or -f or -d or -o'
          echo '  -n X maximum number of test (default is -n "3" or -n "e0 1 2 3")'
          echo '     0 = gzip -9'
          echo '     1 = gzip -9, bzip2 -9'
          echo '     2 = + gzip -9, bzip2 -9 combination [DEFAULT]'
          echo '     4 = + 7z'
          echo '     8 = + gz.7z, bz2.7z, 7z.gz, 7z.bz2 (-9)'
          echo '    14 = + all 7z gz bz2 combination (-9 -9)'
          echo '    30 = + gzip -1, bzip2 -1 to gzip -8, bzip2 -8'
          echo '    31 = + lrzip -L 9'
          echo '    32 = + rzip'
          echo '  -n gz  = 1 16 18 20 22 24 26 28 30 (gzip  -1  -  gzip  -9)'
          echo '  -n bz2 = 2 17 19 21 23 25 27 29 31 (bzip2 -1  -  bzip2 -9)'
          echo '  -n gzbz2 = gz + bz2'
          echo '  -n allbest1 = gz -9, bz2 -9, 7z, lrzip -L 9, rzip -9'
          echo '  -n eX = X is space separated № of tests'
          echo '  '
          waitforkey      
          echo "  -t 'temp/working direcotry path', have to exists, /tmp; is default"
          echo "  -T 'test direcotry name', must not exists 'comptest' is default"
          echo "  -u 'test tar-sub-direcotry name', used with '-d' action."
          echo "        The name is unique name, same name directory as input."
          echo "        mast not exist. Default: TAR-TMP-DIR_0123456789QWX_\$(date '+%s')"
          echo '  '
          echo '  -v verbose process'
          echo "  -w 'file name' of save results !full absolute path!"
          echo "      The saved file can be read by -o action"
          echo "  -e 'file name' of saved tar !full absolute path!"
          echo "      The created tar file contains all files with full path!"
          echo '  -m use "time" for each test (use with -v)'
          echo '  '
          echo "  -l (small letter 'L') leave all compressed files"
          echo '  -L leave the best compreesed ratio file'
          echo '  '
          waitforkey      
          echo "  -b 'size' of device block, default 4096"
          echo '     if -o is used this value is restored from -o file'
          echo '  '
          echo "  -s 'speed' \"weight\" abstract limit for slow/fast depends on mim-max internval,"
          echo '        default 0.5'
          echo "  -r 'ratio' \"weight\" abstract limit for  bad/good depends on mim-max internval,"
          echo '       default 0.5'
          echo "  -R 'min' commpresion ratio for graph (dot vertical line) default 0.75."
          echo '                                          (compressed is 25 % smaller)'
          echo '     if the value is out of graph area the border of graph is interleaved '
          echo '      by dots on right or left side'
          echo "  -S 'min' speed for graph (tilda horizontal line) default 4194304 = 4MiB/sec."
          echo '     if the value is out of graph area the spaces on the left & right of '
          echo '      text "compression ratio" is filled by ~ (on top or bottom)'
          echo '  '
          waitforkey
          echo '  -i input full filename from stdin'
          echo '     USE AS LAST PARAMETR (next paramters are not used)'
          echo '      all no-regular-file will be ignored'
          echo '      !Use full absolute path!'      
          echo '  -d input full direcory name from stdin'
          echo '      on each directory tar is used and the tar is tested'
          echo '     USE AS LAST PARAMETR (next paramters are not used)'
          echo '      all no-director will be ignored'
          echo '      !Use full absolute path!'      
          echo '  -f input full filenames as next parameters'
          echo '     USE AS LAST PARAMETR (next paramters are the full file names)'      
          echo '      all no-regular-file is ignored'
          echo '      !Use full absolute path!'
          echo '  -o file name, read saved result file - no test, show result only'
          echo '     USE AS LAST PARAMETR (next paramters is the file name only)'      
          echo '  '      
          echo '  -I stop each max 25 lines (for help use it as the first parametr)'
          echo '  -c use invertcolor in graph'
          waitforkey
          echo ' '
          echo ' Example:'                                
          echo '   comptest.bash -f fullfilename fullfilename fullfilename'
          echo '     or'
          echo '   find ./* -type f -exec readlink -f {} \; | ./comptest.bash -i'
          echo '     or'
          echo '   find /fullpath/dir/ -midepth 1 maxdepth 1 -type d | ./comptest.bash -d'
          exit 0
          ;;  
        \?)
          echo "Invalid option: -$OPTARG" >&2
          exit 1
          ;;
        :)
          echo "Option -$OPTARG requires an argument." >&2
          exit 1
          ;;
      esac
    done
    
    if [ ! -d "${TMP}" ]; then
      echo "Use -t, Temp path '${TMP}' doesn't exist." >&2
      exit 1
    fi
    
    if [ -d "${TMP}/${TMPDIR}" ]; then
      echo "Use -T, Testing directory '${TMPDIR}' already exist (Maybe it is an artefact from an unfinished test)." >&2
      exit 1
    fi
    
    if [ "${INPUTTYPE}" -lt "-4" ]; then
      echo "Use -i or -f or -d or -o param, or -h for help." >&2
      exit 1
    fi
    
    
    
    #Functions  -----------------------
    HLP_BC_FORMAT_OUT_NUMBER4='if(x<1000) print " "; if(x<100) print " "; if(x<10) print " "; if(x<1) print 0; x'
    HLP_BC_FORMAT_OUT_NUMBER4INT='if(x<1000) print " "; if(x<100) print " "; if(x<10) print " "; x'
    HLP_BC_FORMAT_OUT_NUMBER2INT='if(x<10) print " "; x'
    HLP_BC_FORMAT_OUT_NUMBER6INT='if(x<1000000) print " "; if(x<100000) print " "; if(x<10000) print " "; if(x<1000) print " "; if(x<100) print " "; if(x<10) print " "; x'
    HLP_BC_FORMAT_OUT_NUMBER1='if(x<1 && x>0) print 0; x'
    HLP_BC_FORMAT_OUT_NUMBER2='if(x<10) print " "; if(x<1) print 0; x'
    HLP_BC_FORMAT_OUT_NUMBER1INT='x'
    HLP_BC_FORMAT_DIGIT0='scale=0; if(x<0)x=(x-0.5)/1; if(x>=0)x=(x+0.5)/1;'
    HLP_BC_FORMAT_DIGIT2="scale=6;   x=x*100; ${HLP_BC_FORMAT_DIGIT0} scale=2;   x=x/100;"
    HLP_BC_FORMAT_DIGIT3="scale=6;  x=x*1000; ${HLP_BC_FORMAT_DIGIT0}; scale=3;  x=x/1000;"
    HLP_BC_FORMAT_DIGIT4="scale=6; x=x*10000; ${HLP_BC_FORMAT_DIGIT0}; scale=4; x=x/10000;"
    
    function gettime() {
      echo -n $( date +'%s.%N' )
    }
    
    
    #1st argument start time
    #2st argument finished time
    #3st argument size 
    function getspeed() {
      if [ -z "$1" -a -z "$2" -a -z "$3" ]; then
        echo "Type of input of getspeed function mismatch error." >&2
        exit 3
      fi
      echo "scale=9; x=$3/( $2 - $1 ); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD 
    }
    
    #1st argument start time
    #2st argument compresed size 
    function getratio() {
      if [ -z "$1" -a -z "$2" ]; then
        echo "Type of input of getratio function mismatch error." >&2
        exit 3
      fi
      echo "scale=9; x=$2/$1; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD 
    }
    
    #1st argument start time
    #2st argument compresed size 
    function getratio_block() {
      if [ -z "$1" -a -z "$2" ]; then
        echo "Type of input of getratio function mismatch error." >&2
        exit 3
      fi
      a="$( echo "scale=0; a=($1/${SIZE_OF_BLOCK})+1; scale=9; a*(${SIZE_OF_BLOCK} + ${ADD_SIZE_TO_BLOCK})" | $BCCMD )"
      b="$( echo "scale=0; a=($2/${SIZE_OF_BLOCK})+1; scale=9; a*(${SIZE_OF_BLOCK} + ${ADD_SIZE_TO_BLOCK})" | $BCCMD )"
      echo "scale=9; x=$b/$a; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD
    }
    
    #mult by 100; with 2 decimal digits
    function format_ratio() {
      if [ -z "$1" ]; then
        echo "Type of input of format_ratio function mismatch error." >&2
        exit 3
      fi
      if [ "$#" -gt "1" ]; then
        r="$( echo "scale=9; x=$1*100.0; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
        echo -n "$r %"
        exit 1
      fi
      r="$( echo "scale=9; x=$1*100.0; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER4}" | $BCCMD )"
      r2="$( echo "x=$1; ${HLP_BC_FORMAT_DIGIT4} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      echo -n "${r} %   (${r2})"
    }
    
    #speed i B/sec, KiB/sec MiB/sec
    function format_speed() {
      if [ -z "$1" ]; then
        echo "Type of input of format_speed function mismatch error." >&2
        exit 3
      fi
      n2="$( echo "$1 > 734208" | $BCCMD )"
      n1="$( echo "$1 > 717" | $BCCMD )"
      if [ "$n2" -eq "1" ]; then
        d='1048576'
        suff='MiB/sec'
      elif [ "$n1" -eq "1" ]; then
        d='1024'
        suff='KiB/sec'
      else
        d='1'
        suff='B/sec  '
      fi  
      r="$( echo "scale=9; x=$1/$d; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER4}" | $BCCMD )"
      if [ "$#" -gt "1" ]; then
        echo -n "$r $suff"
        exit 1
      fi
      r2="$( echo "x=$1; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER1INT}" | $BCCMD )"
      echo -n "$r $suff  (${r2} B/sec)"
    }
    
    function format_size() {
      if [ -z "$1" ]; then
        echo "Type of input of format_size function mismatch error." >&2
        exit 3
      fi
      n4="$( echo "$1 > 769872887808" | $BCCMD )"
      n3="$( echo "$1 > 751828992" | $BCCMD )"
      n2="$( echo "$1 > 734208" | $BCCMD )"
      n1="$( echo "$1 > 717" | $BCCMD )"
      if [ "$n4" -eq "1" ]; then
        d='1099511627776'
        suff='TiB'
      elif [ "$n3" -eq "1" ]; then
        d='1073741824'
        suff='GiB'
      elif [ "$n2" -eq "1" ]; then
        d='1048576'
        suff='MiB'
      elif [ "$n1" -eq "1" ]; then
        d='1024'
        suff='KiB'
      else
        d='1'
        suff='B'
      fi  
      r="$( echo "scale=9; x=$1/$d; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER4}" | $BCCMD )"
      r2="$( echo "x=$1; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER1INT}" | $BCCMD )"
      if [ "$d" -eq "1" ]; then
        r="$( echo "x=$1; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER4INT}" | $BCCMD )"
        echo -n "${r} $suff      (${r2} B)"
      else
        echo -n "${r} $suff (${r2} B)"
      fi
    }
    
    function format_time() {
      if [ -z "$1" ]; then
        echo "Type of input of format_time function mismatch error." >&2
        exit 3
      fi
      rmin="$( echo "x=$1/60; ${HLP_BC_FORMAT_OUT_NUMBER2INT}" | $BCCMD )"
      rsec="$( echo "scale=6; x=$1 - ${rmin}*60; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER2}" | $BCCMD )"
      rt="$( echo "x=$1; ${HLP_BC_FORMAT_DIGIT4} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      
      echo -n "${rmin} min ${rsec} sec (${rt} sec)"   
    }
    
    #1st param value array
    #return sorted index asc based on 1st param
    BUBBLE_DESC=0
    BUBBLE_RES=()
    function bubble_sort() {
      local array=($@) 
      local max=$(($# - 1))
      BUBBLE_RES=()
      for((i=0; i < $#; i++)); do
        BUBBLE_RES+=("$i")
      done
      while ((max > 0))
      do
        i=0
        while ((i < max))
        do
          if [ "${BUBBLE_DESC}" -eq "0" ]; then
            r="$( echo "${array[$i]} < ${array[$((i + 1))]}" | $BCCMD )"
          else
            r="$( echo "${array[$i]} > ${array[$((i + 1))]}" | $BCCMD )"
          fi	      
          if [ "$r" -eq "1" ]; then
            v=${array[$i]}
            k=${BUBBLE_RES[$i]}
            array[$i]=${array[$((i + 1))]}
            BUBBLE_RES[$i]=${BUBBLE_RES[$((i + 1))]}
            array[$((i + 1))]=$v
            BUBBLE_RES[$((i + 1))]=$k
          fi
          ((i += 1))
        done
        ((max -= 1))
      done
    }
    
    #variables
    TESTS_COUNT="${#TESTS[@]}"
    #skip file (no regular file) counter
    F_SKIPCNT=0
    
    # 
    RES_FILES_CNT=0
    #time size size_compressed block block_compressed speed ratio ratio_block
    RES_SUM_time=()
    RES_SUM_size=()
    RES_SUM_size_compressed=()
    RES_SUM_block=()
    RES_SUM_block_compressed=()
    RES_SUM_speed=()
    RES_SUM_ratio=()
    RES_SUM_ratio_block=()
    for((i=0; i<${TESTS_COUNT}; i++)); do
      RES_SUM_time+=( 0 )
      RES_SUM_size+=( 0 )
      RES_SUM_size_compressed+=( 0 )
      RES_SUM_block+=( 0 )
      RES_SUM_block_compressed+=( 0 )
      RES_SUM_speed+=( '?' )
      RES_SUM_ratio+=( '?' )
      RES_SUM_ratio_block+=( '?' )
      
    done
    
    # Process function -----------------------
    #need one arguments "full filename"
    function processfile() {
      srcfile="$1"
      old_leave_file_size='999999999999'
      old_leave_file_name=''
      if [ "$VERBOSE" -eq "1" ]; then
        echo -e "\nStart file: '$srcfile'"
      fi
     
      for((i=0; i<${TESTS_COUNT}; i++)); do
        index=${TESTS[$i]}
        if [ ! -f "$srcfile" ]; then
          echo "'processfile' - file doesn't exist." >&2
          exit 5
        fi
        fname="$( basename "$srcfile" )" 
    # ### --- hold tmp dir
        cd "${TMP}/${TMPDIR}"
        if [ "$?" -ne "0" ]; then
          echo "CD ERROR!, 'cd \"${TMP}/${TMPDIR}\"' directory." >&2
          exit 4
        fi
        cp "$srcfile" "./$fname"
        if [ "$?" -ne "0" ]; then
          echo "Copy ERROR!, 'cp \"$srcfile\"' \"./$fname\"" >&2
          exit 4
        fi
        if [ "$VERBOSE" -eq "1" ]; then
          echo "Comprimation cmd: '${TXTA[$index]}'"
          echo -e "--------------------------------------------"
        fi
        cmdtmp="${CMDA[$index]}"
        ext="${EXTA[$index]}"
        ffname=${fname//"'"/"'\"'\"'"}
        cmd="${cmdtmp//\[file\]/$ffname}"
        if [ "$USE_TIME" -eq "1" ]; then
          cmd="time -p $cmd"
        fi
        size="$( stat -c%s "${srcfile}" )"
        if [ "$?" -ne "0" ]; then
          echo "STAT ERROR!, 'stat -c%s \"${srcfile}\"' directory." >&2
          exit 3
        fi
    
        start_t="$( gettime )"
    # ### --- dangerous command
        eval "$cmd"  
        ret_code=$?
        if [ "$ret_code" -ne "0" ]; then
          echo "COMPRIM ERROR!, CMD: '$cmd' ." >&2
          exit 3
        fi 
        stop_t="$( gettime )"
    # ### --- hold tmp dir
        cd "${TMP}/${TMPDIR}"
        if [ "$?" -ne "0" ]; then
          echo "CD ERROR!, 'cd \"${TMP}/${TMPDIR}\"' directory." >&2
          exit 4
        fi
        size_compressed="$( stat -c%s "${fname}${ext}" )"
        if [ "$?" -ne "0" ]; then
          echo "STAT ERROR!, 'stat -c%s \"${fname}${ext}\"' directory." >&2
          exit 3
        fi
        ttime="$( echo "scale=16; x=${stop_t} - ${start_t}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
        speed="$( getspeed "${start_t}" "${stop_t}" "${size}" )"
        ratio="$( getratio "${size}" "${size_compressed}" )"
        ratio_block="$( getratio_block "${size}" "${size_compressed}" )"
        blocks="$( echo "scale=0; (${size}/${SIZE_OF_BLOCK})+1" | $BCCMD )"
        blocks_compressed="$( echo "scale=0; (${size_compressed}/${SIZE_OF_BLOCK})+1" | $BCCMD )"
         
        RES_SUM_time[$i]="$( echo "scale=16; x=${RES_SUM_time[$i]} + ${ttime}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
        RES_SUM_size[$i]="$( echo "${RES_SUM_size[$i]} + ${size}" | $BCCMD )"
        RES_SUM_size_compressed[$i]="$( echo "${RES_SUM_size_compressed[$i]} + ${size_compressed}" | $BCCMD )"
        RES_SUM_block[$i]="$( echo "${RES_SUM_block[$i]} + ${blocks}" | $BCCMD )"
        RES_SUM_block_compressed[$i]="$( echo "${RES_SUM_block_compressed[$i]} + ${blocks_compressed}" | $BCCMD )"
    
        if [ "${LEAVE_COMP}" -eq "2" ]; then
          if [ "${old_leave_file_size}" -gt "${size_compressed}" ]; then
            leaveit=1
            if [ -n "${old_leave_file_name}" ]; then
    # ### --- dangerous command
              rm "${old_leave_file_name}"
              if [ "$?" -ne "0" ]; then
                echo "RM ERROR!, 'rm \"${old_leave_file_name}\"' directory." >&2
                exit 4
              fi    
            fi
            old_leave_file_name="./${fname}${ext}"
            old_leave_file_size="${size_compressed}"          
          else
            leaveit=0  
          fi
        elif [ "${LEAVE_COMP}" -eq "1" ]; then
          leaveit=1
        else
          leaveit=0
        fi
        if [ "${leaveit}" -eq "0" ]; then
    # ### --- dangerous command
          rm "./${fname}${ext}"
          if [ "$?" -ne "0" ]; then
            echo "RM ERROR!, 'rm \"./${fname}${ext}\"' directory." >&2
            exit 4
          fi
        fi      
        if [ -f "${fname}" ]; then
    # ### --- dangerous command
          rm "./${fname}"
          if [ "$?" -ne "0" ]; then
            echo "RM ERROR!, 'rm \"./${fname}\"' directory." >&2
            exit 4
          fi
        fi
        if [ "$VERBOSE" -eq "1" ]; then
          echo "       Time: $( format_time    "${ttime}" )"
          echo "      Speed: $( format_speed   "${speed}" )"
          echo "       Size: $( format_size   "${size}" ); blocks: ${blocks}"
          echo " Compressed: $( format_size   "${size_compressed}" ); blocks: ${blocks_compressed}"
          echo "      Ratio: $( format_ratio   "${ratio}" )"
          echo "Ratio block: $( format_ratio   "${ratio_block}" )"
          echo -e "--------------------------------------------\n"
        fi
      done
    # ### --- dangerous command    
      if [ -n "${TAR_FILENAME}" ]; then
        tr_cmd=	  
        if [ "${RES_FILES_CNT}" -eq "0" ]; then
          tr_cmd="${TAR_CMD[0]}"
        else	    
          tr_cmd="${TAR_CMD[1]}"
        fi 	
        ${tr_cmd} "${TAR_FILENAME}" "$srcfile" 2>/dev/null 
        if [ "$?" -ne "0" ]; then
          echo "TAR ERROR!, ' ${tr_cmd} \"${TAR_FILENAME}\" \"$srcfile\"." >&2
          exit 4
        fi    
      fi  
      RES_FILES_CNT=$(( RES_FILES_CNT + 1 ))
    
      if [ "$VERBOSE" -eq "1" ]; then
        echo -e "End file: '$srcfile'"
      fi
    }
    
    cd "${TMP}"
    if [ "$?" -ne "0" ]; then
      echo "CD ERROR!, 'cd ${TMP}' directory." >&2
      exit 3
    fi
    mkdir "${TMPDIR}"
    if [ "$?" -ne "0" ]; then
      echo "MKDIR ERROR!, 'mkdir \"${TMPDIR}\"' directory." >&2
      exit 3
    fi
    cd "${TMPDIR}"
    if [ "$?" -ne "0" ]; then
      echo "CD ERROR!, 'cd \"${TMPDIR}\"' directory." >&2
      exit 3
    fi
    
    # ------------------ save --------------------
    function save(){
      if [ -n "${SAVE_FILENAME}" ]; then
        echo "# BEGIN $1 comptest.bash utility save file" >  "${SAVE_FILENAME}"
        echo "# SIZE OF BLOCK:" >> "${SAVE_FILENAME}"
        echo "${SIZE_OF_BLOCK}" >> "${SAVE_FILENAME}"
        echo "# TEST COUNT:" >> "${SAVE_FILENAME}"
        echo "${TESTS_COUNT}" >> "${SAVE_FILENAME}"
        echo "# TESTS ARRAY:" >> "${SAVE_FILENAME}"
        echo "${TESTS[@]}" >> "${SAVE_FILENAME}"
        echo "# TESTS RESULT COUNTS:" >> "${SAVE_FILENAME}"
        echo "${RES_FILES_CNT}" >> "${SAVE_FILENAME}"
        echo "# NO REGULAR FILES COUNTS:" >> "${SAVE_FILENAME}"
        echo "${F_SKIPCNT}" >> "${SAVE_FILENAME}"
        echo "# SUM TIME ARRAY:" >> "${SAVE_FILENAME}"
        echo "${RES_SUM_time[@]}" >> "${SAVE_FILENAME}"
        echo "# SUM SIZE ARRAY:" >> "${SAVE_FILENAME}"
        echo "${RES_SUM_size[@]}" >> "${SAVE_FILENAME}"
        echo "# SUM SIZE COMPRESSED ARRAY:" >> "${SAVE_FILENAME}"
        echo "${RES_SUM_size_compressed[@]}" >> "${SAVE_FILENAME}"
        echo "# SUM BLOCK COUNT ARRAY:" >> "${SAVE_FILENAME}"
        echo "${RES_SUM_block[@]}" >> "${SAVE_FILENAME}"
        echo "# SUM COMPRESSED BLOCK COUNT ARRAY:" >> "${SAVE_FILENAME}"
        echo "${RES_SUM_block_compressed[@]}" >> "${SAVE_FILENAME}"
        echo "# END $1 comptest.bash utility save file" >>  "${SAVE_FILENAME}"
      fi
    }
    # --------------------------------------------
    
    breakit=0
    function control_c(){
    #  echo "Interupting..."
      if [ "${breakit}" -gt "0" ]; then 
        exit 3
      fi
      breakit=1
    }
    
    # ----- trap -------
    trap control_c INT  
    #process all files  -----------------------
    if [ "${INPUTTYPE}" -eq "-2" ]; then
      echo "Started -i, stdin file names"
      while read file; do
        if [ -f "$file" ]; then
          processfile "$file"
        else
          F_SKIPCNT=$(( F_SKIPCNT + 1 ))  
          if [ "$VERBOSE" -eq "1" ]; then
            echo  "The file '$1' is not regular file"
          fi        
        fi
        if [ "${breakit}" -ne "0" ]; then
          echo "Interupted…"
          save 'interupted'
          exit 3
        else
          save 'in progess'
        fi
      done
    elif [ "${INPUTTYPE}" -eq "-1" ]; then
    	echo "Started -f, file names as parametrs"
      while  [ "$#" != "0" ]; do
        if [ -f "$1" ]; then
          processfile "$1"
        else
          F_SKIPCNT=$(( F_SKIPCNT + 1 ))
          if [ "$VERBOSE" -eq "1" ]; then
            echo "The file '$1' is not regular file"
          fi        
        fi
        if [ "${breakit}" -ne "0" ]; then
          echo "Interupted…"
          save 'interupted'
          exit 3
        else
          save 'in progess'
        fi
        shift  
      done
    elif [ "${INPUTTYPE}" -eq "-3" ]; then
      echo "Started -o, read saved data"
      i='0'
      while read line; do
        if [ "$i" -eq "2" ]; then
          SIZE_OF_BLOCK="${line}"
        elif [ "$i" -eq "4" ]; then
          TESTS_COUNT="${line}"
        elif [ "$i" -eq "6" ]; then
          TESTS=( ${line} )
        elif [ "$i" -eq "8" ]; then
          RES_FILES_CNT="${line}"
        elif [ "$i" -eq "10" ]; then
          F_SKIPCNT="${line}"
        elif [ "$i" -eq "12" ]; then
          RES_SUM_time=( ${line} )
        elif [ "$i" -eq "14" ]; then
          RES_SUM_size=( ${line} )
        elif [ "$i" -eq "16" ]; then
          RES_SUM_size_compressed=( ${line} )
        elif [ "$i" -eq "18" ]; then
          RES_SUM_block=( ${line} )
        elif [ "$i" -eq "20" ]; then
          RES_SUM_block_compressed=( ${line} )
        fi	   
        i=$((i=i+1))
      done < "${OPEN_FILENAME}"
      RES_SUM_speed=()
      RES_SUM_ratio=()
      RES_SUM_ratio_block=()
      for((i=0; i<${TESTS_COUNT}; i++)); do
        RES_SUM_speed+=( '?' )
        RES_SUM_ratio+=( '?' )
        RES_SUM_ratio_block+=( '?' )
      done  
    elif [ "${INPUTTYPE}" -eq "-4" ]; then
      echo "Started -d, tar directory"
      mkdir "${TMP}/${TMPDIR}/${TAR_TMP_DIR}"
      if [ "$?" -ne "0" ]; then
        echo "MKDIR ERROR!, 'mkdir \"${TMP}/${TMPDIR}/${TAR_TMP_DIR}\"' directory." >&2
        exit 3
      fi
      while read dir; do
        if [ -d "$dir" ]; then
          drname="$( basename "$dir" )" 
    # ### --- hold tmp dir
          cd "${TMP}/${TMPDIR}"
          if [ "$?" -ne "0" ]; then
            echo "CD ERROR!, 'cd \"${TMP}/${TMPDIR}\"' directory." >&2
            exit 4
          fi
          tr_cmd="${TAR_CMD[0]}"
    # ### --- dangerous command    	    
          ${tr_cmd} "${TAR_TMP_DIR}/${drname}.tar" "$dir" 2>/dev/null 
          if [ "$?" -ne "0" ]; then
            echo "TAR DIRECTORY ERROR!, '${tr_cmd} \"${TAR_TMP_DIR}/${drname}.tar\" \"$dir\"'." >&2
            exit 3
          fi    
          processfile "${TMP}/${TMPDIR}/${TAR_TMP_DIR}/${drname}.tar"
    # ### --- hold tmp dir
          cd "${TMP}/${TMPDIR}"
          if [ "$?" -ne "0" ]; then
            echo "CD ERROR!, 'cd \"${TMP}/${TMPDIR}\"' directory." >&2
            exit 4
          fi
    # ### --- dangerous command    	          
          rm "./${TAR_TMP_DIR}/${drname}.tar" 
          if [ "$?" -ne "0" ]; then
            echo "RM ERROR!, 'rm \"./${TAR_TMP_DIR}/${drname}.tar}\"'." >&2
            exit 3
          fi    
        else
          F_SKIPCNT=$(( F_SKIPCNT + 1 ))
          if [ "$VERBOSE" -eq "1" ]; then
            echo "The file '$1' is not directory"
          fi        
        fi
        if [ "${breakit}" -ne "0" ]; then
          echo "Interupted…"
          save 'interupted'
          exit 3
        else
          save 'in progess'
        fi
        shift  
      done
      rmdir "${TMP}/${TMPDIR}/${TAR_TMP_DIR}"
      if [ "$?" -ne "0" ]; then
        echo "RMDIR ERROR!, 'rmdir \"${TMP}/${TMPDIR}/${TAR_TMP_DIR}\"' directory." >&2
        exit 3
      fi
    else	
      echo "Type of input mismatch error." >&2      
    fi
    # ------------------------------------------
    
    # ------------------ save it -----------------
    if [ "${breakit}" -eq "0" ]; then
      save 'finished'
    fi
    # --------------------------------------------
    
    #report -----------------------
    EVOL_REF_PR=0.25
    EVOL_LOWER_PR=0.05
    EVOL_SAME_PR=0.005
    EVOL_CHR=( '==' ' =' ' v' 'vv' '&&' )
    CHR_LOW=' v'
    CHR_LOW2='vv'
    EVOL_UNLIM='99999999999999999999'
    EVOL_LAST_VALUE="-${EVOL_UNLIM}"
    EVOL_RES=''
    EVOL_SIDE=0
    function start_evolution() {
      if [ "$1" -eq "0" ]; then
        EVOL_LAST_VALUE="${EVOL_UNLIM}"
      else
        EVOL_LAST_VALUE="-${EVOL_UNLIM}"
      fi
      EVOL_SIDE=0
    }
    function evolution() {
      if [ "$2" -eq "0" ]; then
        r="$( echo "scale=2; x=${EVOL_LAST_VALUE} - $1; scale=0; r=4; if(x < (${EVOL_REF_PR}*${EVOL_LAST_VALUE})) r-=1; if(x < (${EVOL_LOWER_PR}*${EVOL_LAST_VALUE})) r-=1; if(x < (${EVOL_SAME_PR}*${EVOL_LAST_VALUE})) r-=1; if(x == 0) r=0; r" | $BCCMD )"
      else
        r="$( echo "scale=2; x=(${EVOL_LAST_VALUE} - $1)* -1; scale=0; r=4; if(x < (${EVOL_REF_PR}*${EVOL_LAST_VALUE})) r-=1; if(x < (${EVOL_LOWER_PR}*${EVOL_LAST_VALUE})) r-=1; if(x < (${EVOL_SAME_PR}*${EVOL_LAST_VALUE})) r-=1; if(x == 0) r=0;  r" | $BCCMD )"
      fi  
      if [ "$r" -eq "4" ]; then
        EVOL_LAST_VALUE="$1"
        if [ "${EVOL_SIDE}" -eq "0" ]; then
          EVOL_SIDE=1
        else
          EVOL_SIDE=0
        fi
      fi
      if [ "${EVOL_SIDE}" -eq "0" ]; then
        EVOL_RES="|${EVOL_CHR[$r]} "
      else
        EVOL_RES=" ${EVOL_CHR[$r]}|"
      fi
    }
    function width_itselfl(){
      x="$1"
      while [ ${#x} -lt "$2" ] ; do
        x=" $x"
      done
      echo "$x"
    }
    function width_itselfr(){
      x="$1"
      while [ ${#x} -lt "$2" ]; do
        x="$x "
      done
      echo "$x"
    }
    function gauge(){
      x=""
      if [ $# -gt "2" ]; then
        if [ "$3" -gt "0" ]; then
          x="<<<<<${line:3}"      
          width_itselfr "$x" "${2}"
        else
          while [ ${#x} -lt "$1" ]; do
            x="$x#"
          done
          x="${x:0:$(($2-5))}>>>>>"	    
          x="${GRAPH_POINT/\[letter\]/${x}}"
          width_itselfr "$x" "$((${2}+${GRAPH_POINT_L}))"
        fi
      else
        while [ ${#x} -lt "$1" ]; do
          x="$x#"
        done
        x="${GRAPH_POINT/\[letter\]/${x}}"
        width_itselfr "$x" "$((${2}+${GRAPH_POINT_L}))"
      fi  
    }
    
    function toaverage(){
      if [ "$1" -eq "-1" ]; then
        echo '-| '
      else
        echo ' |+'
      fi
    }  
    function toweightspeed(){
      if [ "$1" -eq "-1" ]; then
        echo 'slow|    '
      else
        echo '    |fast'
      fi
    }
    function toweightratio(){
      if [ "$1" -eq "-1" ]; then
        echo 'bad|    '
      else
        echo '   |good'
      fi
    }
    function nook(){
     if [ "$1" -eq "1" ]; then
        echo 'no|  '
      else
        echo '  |OK'
      fi
    }
    
    # ------ compute necessary values ----------
    SUM_time='0'
    SUM_size='0'
    SUM_size_compressed='0'
    TEST_INFO=()
    TEST_SHORT_INFO=()
    AVG_SPEED='0'
    AVG_RATIO='0'
    AVG_RATIO_BLOCK='0'
    MIN_SPEED='99999999999999999999'
    MIN_RATIO='99999999999999999999'
    MIN_RATIO_BLOCK='99999999999999999999'
    MAX_SPEED='0'
    MAX_RATIO='0'
    MAX_RATIO_BLOCK='0'
    
    
    NAME_WIDTH=20
    for((i=0; i<${TESTS_COUNT}; i++)); do
      RES_SUM_speed[$i]="$( echo "scale=12; x=${RES_SUM_size[$i]}/${RES_SUM_time[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      AVG_SPEED="$( echo "scale=12; x=${AVG_SPEED} + ${RES_SUM_speed[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MIN_SPEED="$( echo "scale=12; x=${RES_SUM_speed[$i]}; if(${MIN_SPEED}<x) x=${MIN_SPEED}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MAX_SPEED="$( echo "scale=12; x=${RES_SUM_speed[$i]}; if(${MAX_SPEED}>x) x=${MAX_SPEED}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      RES_SUM_ratio[$i]="$( echo "scale=9; x=${RES_SUM_size_compressed[$i]}/${RES_SUM_size[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      AVG_RATIO="$( echo "scale=12; x=${AVG_RATIO} + ${RES_SUM_ratio[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MIN_RATIO="$( echo "scale=12; x=${RES_SUM_ratio[$i]}; if(${MIN_RATIO}<x) x=${MIN_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MAX_RATIO="$( echo "scale=12; x=${RES_SUM_ratio[$i]}; if(${MAX_RATIO}>x) x=${MAX_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      RES_SUM_ratio_block[$i]="$( echo "scale=9; x=${RES_SUM_block_compressed[$i]}/${RES_SUM_block[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      AVG_RATIO_BLOCK="$( echo "scale=12; x=${AVG_RATIO_BLOCK} + ${RES_SUM_ratio_block[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MIN_RATIO_BLOCK="$( echo "scale=12; x=${RES_SUM_ratio_block[$i]}; if(${MIN_RATIO_BLOCK}<x) x=${MIN_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      MAX_RATIO_BLOCK="$( echo "scale=12; x=${RES_SUM_ratio_block[$i]}; if(${MAX_RATIO_BLOCK}>x) x=${MAX_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      SUM_time="$( echo "scale=12; x=${SUM_time} + ${RES_SUM_time[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      SUM_size="$( echo "scale=12; x=${SUM_size} + ${RES_SUM_size[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      SUM_size_compressed="$( echo "scale=12; x=${SUM_size_compressed} + ${RES_SUM_size_compressed[$i]}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      #create info
      testi="${TESTS[$i]}"
      #do not change '20' !
      TEST_SHORT_INFO+=( "[ $(width_itselfr "${TXTA[$testi]}" ${NAME_WIDTH}) ]" )
      str="${TEST_SHORT_INFO[$i]} S: $(width_itselfl "$( format_speed "${RES_SUM_speed[$i]}" 1 )" 14 ); R: $(width_itselfl "$( format_ratio "${RES_SUM_ratio[$i]}" 1 )" 8 ); RB: $(width_itselfl "$( format_ratio "${RES_SUM_ratio_block[$i]}" 1 )" 8 )"
      TEST_INFO+=( "${str}" )
    done
    AVG_SPEED="$( echo "scale=9; x=${AVG_SPEED} / ${TESTS_COUNT}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    AVG_RATIO="$( echo "scale=9; x=${AVG_RATIO}  / ${TESTS_COUNT}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    AVG_RATIO_BLOCK="$( echo "scale=9; x=${AVG_RATIO_BLOCK} / ${TESTS_COUNT}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    
    
    # --- sort results ------------------------- 
    BUBBLE_DESC=0
    bubble_sort "${RES_SUM_speed[@]}"
    speed_index=(${BUBBLE_RES[@]})
    BUBBLE_DESC=1
    bubble_sort "${RES_SUM_ratio[@]}" 
    ratio_index=(${BUBBLE_RES[@]})
    BUBBLE_DESC=1
    bubble_sort "${RES_SUM_ratio_block[@]}" 
    ratio_index_block=(${BUBBLE_RES[@]})
    #echo "${speed_index[@]}"
    #echo "${ratio_index[@]}"
    #echo "${ratio_index_block[@]}" 
    #echo "${RES_SUM_speed[@]}"
    #echo "${RES_SUM_size[@]}"
    #echo "${RES_SUM_size_compressed[@]}"
    #echo "${RES_SUM_block[@]}"
    #echo "${RES_SUM_block_compressed[@]}"
    #echo "${RES_SUM_speed[@]}"
    #echo "${RES_SUM_ratio[@]}"
    #echo "${RES_SUM_ratio_block[@]}"
    
    echo ''
    echo '# SUMARRY ####################################################################'
    echo "#                 Tested files: $(echo "x=${RES_FILES_CNT}; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER6INT}" | $BCCMD )"
    echo "#     Skipped no-regular files: $(echo "x=${F_SKIPCNT}; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER6INT}" | $BCCMD )"
    echo "#          Tested method count: $(echo "x=${TESTS_COUNT}; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER6INT}" | $BCCMD )"
    echo '#-----------------------------------------------------------------------------'
    echo "#         All compression time: $( format_time "${SUM_time}" )"
    echo "#        All tested files size: $( format_size "${RES_SUM_size[0]}" ); blocks: ${RES_SUM_block[0]}"
    echo "#      All tested files blocks: $(echo "x=${RES_SUM_block[0]}; ${HLP_BC_FORMAT_DIGIT0} ${HLP_BC_FORMAT_OUT_NUMBER6INT}" | $BCCMD )"
    block_size="$( echo "scale=9; x=${RES_SUM_block[0]}*(${SIZE_OF_BLOCK} + ${ADD_SIZE_TO_BLOCK}); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    echo "#  All tested files block size: $( format_size "${block_size}" )"
    echo '#-----------------------------------------------------------------------------'
    waitforkey
    echo "#                Average speed: $(width_itselfl "$( format_speed "${AVG_SPEED}" 0 )" 18)"  
    echo "#       Average compress ratio: $(width_itselfl "$( format_ratio "${AVG_RATIO}" 1 )" 12)" 
    echo "# Average compress ratio block: $(width_itselfl "$( format_ratio "${AVG_RATIO_BLOCK}" 1 )" 12)"  
    echo '#-----------------------------------------------------------------------------'
    echo "#                Minimum speed: $(width_itselfl "$( format_speed "${MIN_SPEED}" 0 )" 18)"  
    echo "#       Minimum compress ratio: $(width_itselfl "$( format_ratio "${MIN_RATIO}" 1 )" 12)    (the best)" 
    echo "# Minimum compress ratio block: $(width_itselfl "$( format_ratio "${MIN_RATIO_BLOCK}" 1 )" 12)    (the best)"  
    echo '#-----------------------------------------------------------------------------'
    echo "#                Maximum speed: $(width_itselfl "$( format_speed "${MAX_SPEED}" 0 )" 18)"  
    echo "#       Maximum compress ratio: $(width_itselfl "$( format_ratio "${MAX_RATIO}" 1 )" 12)    (the worst)" 
    echo "# Maximum compress ratio block: $(width_itselfl "$( format_ratio "${MAX_RATIO_BLOCK}" 1 )" 12)    (the worst)"  
    echo '#-----------------------------------------------------------------------------'
    echo "#        All uncompressed read: $( format_size "${SUM_size}" )"
    echo "#        All compressed writes: $( format_size "${SUM_size_compressed}" )"
    echo '##############################################################################'
    waitforkey
    
    GAUGEWIDTH=25
    
    echo ''
    echo '# ORDER BY SPEED ##################^^^^^^^####################################'
    cnt="${#speed_index[@]}"
    start_evolution 0
    for((i=0; i<${cnt}; i++)); do
      index="${speed_index[$i]}"
      evolution "${RES_SUM_speed[$index]}" 0
      echo "# ${EVOL_RES} ${TEST_INFO[$index]}" 
    done
    echo '#-----------------------------------------------------------------------------'
    waitforkey
    int="$( echo "scale=12; x=${GAUGEWIDTH}/(${MAX_SPEED} - ${MIN_SPEED}); if(x<0.00000000001) x=0.00000000001; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    tmp_w="$( echo "scale=12; x=${REPORT_SPEED_W}*(${MAX_SPEED} - ${MIN_SPEED}) + ${MIN_SPEED}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    ww="$( echo "scale=12; x=${GAUGEWIDTH}*${REPORT_SPEED_W}; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    rr="$( echo "scale=12; x=${REPORT_SPEED_W}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    a="$( echo "scale=12; x=-1; if(${tmp_w}>${AVG_SPEED}) x=1; x" | $BCCMD )"
    w="$( echo "scale=12; x=${int}*(${AVG_SPEED} - ${MIN_SPEED}); ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    r="$( echo "scale=12; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    s="$( echo "scale=12; x=-1; if(${AVG_SPEED}>${tmp_w}) x=1; x" | $BCCMD )"
    echo -e "# [ $(width_itselfr "Average speed" ${NAME_WIDTH} ) ] $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) %  &|&  $(toweightspeed "$s")"
    echo -e "# [ $(width_itselfr "Speed alimit -s $(echo "scale=3; x=${REPORT_SPEED_W}; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD)" ${NAME_WIDTH} ) ] $(gauge "$ww" "${GAUGEWIDTH}") $(width_itselfl $rr 3) %  $(toaverage "$a")     &|&"
    echo '#   --------------------  |-------------------------|        |       |       '
    for((i=0; i<${cnt}; i++)); do
      index="${speed_index[$i]}"
      w="$( echo "scale=12; x=${int}*(${RES_SUM_speed[$index]} - ${MIN_SPEED}); ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      r="$( echo "scale=12; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      a="$( echo "scale=12; x=-1; if(${RES_SUM_speed[$index]}>${AVG_SPEED}) x=1; x" | $BCCMD )"
      s="$( echo "scale=12; x=-1; if(${RES_SUM_speed[$index]}>${tmp_w}) x=1; x" | $BCCMD )"
      echo -e "# ${TEST_SHORT_INFO[$index]} $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) %  $(toaverage "$a")  $(toweightspeed "$s")" 
    done
    echo '##############################################################################'
    waitforkey
    echo ''
    echo '# ORDER BY COMPRESSED FILE SIZE #######################vvvvvv#################'
    cnt="${#ratio_index[@]}"
    start_evolution 1
    for((i=0; i<${cnt}; i++)); do
      index="${ratio_index[$i]}"
      evolution "${RES_SUM_ratio[$index]}" 1
      echo "# ${EVOL_RES} ${TEST_INFO[$index]}" 
    done
    echo '#-----------------------------------------------------------------------------'
    waitforkey
    min="$( echo "scale=9; x=1 - ${MAX_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    max="$( echo "scale=9; x=1 - ${MIN_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    avg="$( echo "scale=9; x=1 - ${AVG_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    int="$( echo "scale=9; x=${GAUGEWIDTH}/(${max} - ${min}); if(x<0.00000001) x=0.00000001; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    tmp_w="$( echo "scale=9; x=(${REPORT_RATIO_W}*(${max} - ${min}) + ${min}); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    ww="$( echo "scale=9; x=${GAUGEWIDTH}*${REPORT_RATIO_W}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    rr="$( echo "scale=9; x=${REPORT_RATIO_W}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    a="$( echo "scale=9; x=-1; if(${tmp_w}>(${avg})) x=1; x" | $BCCMD )"
    w="$( echo "scale=9; x=${int}*(${avg} - ${min}); ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    r="$( echo "scale=9; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    s="$( echo "scale=9; x=-1; if((${avg})>${tmp_w}) x=1; x" | $BCCMD )"
    r_min="$( echo "scale=6; x=((${max} - ${min})/${GAUGEWIDTH}); if(x<0.000001) x=0.000001; x=((1 - ${REPORT_RATIO_MIN}) - ${min})/x; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    if [ "${r_min}" -lt "0" ]; then
     g_lim="$(gauge "0" "${GAUGEWIDTH}" "1")"
     g_rr=' <<<<'
    elif [ "${r_min}" -gt "${GAUGEWIDTH}" ]; then
      g_lim="$(gauge "${GAUGEWIDTH}" "${GAUGEWIDTH}" "0")"
      g_rr=' >>>>'
    else
      g_lim="$(gauge "$r_min" "${GAUGEWIDTH}")"
      g_rr="$( width_itselfl "$( echo "scale=6; x=${r_min}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )" 3 ) %"
    fi
    echo -e "# [ $(width_itselfr "Compress min -R $(echo "scale=3; x=${REPORT_RATIO_MIN}; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD)" ${NAME_WIDTH} ) ] ${g_lim} ${g_rr}  |     |      &|&"
    yesno=$(echo "${AVG_RATIO}>=${REPORT_RATIO_MIN}" | $BCCMD)
    echo -e "# [ $(width_itselfr "Average ratio" ${NAME_WIDTH} ) ] $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) % &|& $(toweightratio "$s") $(nook "$yesno")"
    echo -e "# [ $(width_itselfr "Ratio alimit -r $(echo "scale=3; x=${REPORT_RATIO_W}; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD)" ${NAME_WIDTH} ) ] $(gauge "$ww" "${GAUGEWIDTH}") $(width_itselfl $rr 3) % $(toaverage "$a")   &|&      |"
    echo '#   --------------------  |-------------------------|       |     |       |'
    for((i=0; i<${cnt}; i++)); do
      index="${ratio_index[$i]}"
      yesno="$(echo "(${RES_SUM_ratio[$index]})>=${REPORT_RATIO_MIN}" | $BCCMD)"
      w="$( echo "scale=9; x=${int}*((1 - ${RES_SUM_ratio[$index]}) - ${min}); ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      r="$( echo "scale=9; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      a="$( echo "scale=9; x=-1; if((1 - ${RES_SUM_ratio[$index]}>${avg})) x=1; x" | $BCCMD )"
      s="$( echo "scale=9; x=-1; if((1 - ${RES_SUM_ratio[$index]}>${tmp_w})) x=1; x" | $BCCMD )"
      echo -e "# ${TEST_SHORT_INFO[$index]} $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) % $(toaverage "$a") $(toweightratio "$s") $(nook "$yesno")"
    done
    echo '##############################################################################'
    waitforkey
    echo ''
    
    echo '# ORDER BY COMPRESSED FILE BLOCK COUNT ##############################vvvvvv###'
    cnt="${#ratio_index_block[@]}"
    start_evolution 1
    for((i=0; i<${cnt}; i++)); do
      index="${ratio_index_block[$i]}"
      evolution "${RES_SUM_ratio_block[$index]}" 1
      echo "# ${EVOL_RES} ${TEST_INFO[$index]}" 
    done
    echo '#-----------------------------------------------------------------------------'
    waitforkey
    min="$( echo "scale=9; x=1 - ${MAX_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    max="$( echo "scale=9; x=1 - ${MIN_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    avg="$( echo "scale=9; x=1 - ${AVG_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    int="$( echo "scale=9; y=${max} - ${min}; if(y < 0.00000001) y=0.00000001; x=${GAUGEWIDTH}/y; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    tmp_w="$( echo "scale=9; x=(${REPORT_RATIO_W}*(${max} - ${min}) + ${min}); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    ww="$( echo "scale=9; x=${GAUGEWIDTH}*${REPORT_RATIO_W}; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    rr="$( echo "scale=9; x=${REPORT_RATIO_W}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    a="$( echo "scale=9; x=-1; if(${tmp_w}>(${avg})) x=1; x" | $BCCMD )"
    w="$( echo "scale=9; x=${int}*(${avg} - ${min}); ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    r="$( echo "scale=9; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
    s="$( echo "scale=9; x=-1; if((${avg})>${tmp_w}) x=1; x" | $BCCMD )"
    r_min="$( echo "scale=6; x=((${max} - ${min})/${GAUGEWIDTH}); if(x<0.000001) x=0.000001; x=((1 - ${REPORT_RATIO_MIN}) - ${min})/x; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    if [ "${r_min}" -lt "0" ]; then
     g_lim="$(gauge "0" "${GAUGEWIDTH}" "1")"
     g_rr=' <<<<'
    elif [ "${r_min}" -gt "${GAUGEWIDTH}" ]; then
      g_lim="$(gauge "${GAUGEWIDTH}" "${GAUGEWIDTH}" "0")"
      g_rr=' >>>>'
    else
      g_lim="$(gauge "$r_min" "${GAUGEWIDTH}")"
      g_rr="$( width_itselfl "$( echo "scale=6; x=${r_min}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )" 3 ) %"
    fi
    echo -e "# [ $(width_itselfr "Compress min -R $(echo "scale=3; x=${REPORT_RATIO_MIN}; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD)" ${NAME_WIDTH} ) ] ${g_lim} ${g_rr}  |     |      &|&"
    yesno=$(echo "${AVG_RATIO_BLOCK}>=${REPORT_RATIO_MIN}" | $BCCMD)
    echo -e "# [ $(width_itselfr "Average ratio block" ${NAME_WIDTH} ) ] $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) % &|& $(toweightratio "$s")   |"
    echo -e "# [ $(width_itselfr "Ratio limit -r $(echo "scale=3; x=${REPORT_RATIO_W}; ${HLP_BC_FORMAT_DIGIT2} ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD)" ${NAME_WIDTH} ) ] $(gauge "$ww" "${GAUGEWIDTH}") $(width_itselfl $rr 3) % $(toaverage "$a")   &|&      |"
    echo '#   --------------------  |-------------------------|       |     |       |'
    for((i=0; i<${cnt}; i++)); do
      index="${ratio_index_block[$i]}"
      yesno="$(echo "(${RES_SUM_ratio_block[$index]})>=${REPORT_RATIO_MIN}" | $BCCMD)"
      w="$( echo "scale=9; x=${int}*((1 - ${RES_SUM_ratio_block[$index]}) - ${min}); ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      r="$( echo "scale=9; x=${w}/${GAUGEWIDTH}*100; ${HLP_BC_FORMAT_DIGIT0}; x" | $BCCMD )"
      a="$( echo "scale=9; x=-1; if((1 - ${RES_SUM_ratio_block[$index]}>${avg})) x=1; x" | $BCCMD )"
      s="$( echo "scale=9; x=-1; if((1 - ${RES_SUM_ratio_block[$index]}>${tmp_w})) x=1; x" | $BCCMD )"
      echo -e "# ${TEST_SHORT_INFO[$index]} $(gauge "$w" "${GAUGEWIDTH}") $(width_itselfl $r 3) % $(toaverage "$a") $(toweightratio "$s") $(nook "$yesno")" 
    done
    echo '##############################################################################'
    echo ''
    if [ "$STOPIT" -eq "1" ]; then
      echo "Next two wait for any key without message will be required."
    fi
    waitforkey
    # ----- graph data -------------------------------------
    grdata=()
    grdata+=( '#  |                                                                         |' )
    grdata+=( '# ^|                                                                         |' )
    grdata+=( '# ^|                                                                         |' )
    grdata+=( '# ^|                                                                         |' )
    grdata+=( '#  |                                                                         |' )
    grdata+=( '# f|                                                                         |' )
    grdata+=( '# a|                                                                         |' )
    grdata+=( '# s|                                                                         |' )
    grdata+=( '# t|                                                                         |' )
    grdata+=( '#  |                                                                         |' )
    grdata+=( '# s|                                                                         |' )
    grdata+=( '# p|                                                                         |' )
    grdata+=( '# e|                                                                         |' )
    grdata+=( '# e|                                                                         |' )
    grdata+=( '# d|                                                                         |' )
    grdata+=( '#  |                                                                         |' )
    grdata+=( '# s|                                                                         |' )
    grdata+=( '# l|                                                                         |' )
    grdata+=( '# o|                                                                         |' )
    grdata+=( '# w|                                                                         |' )
    grdata+=( '#  |                                                                         |' )
    grdata+=( '# v|                                                                         |' )
    grdata+=( '# v|                                                                         |' )
    grdata+=( '# v|                                                                         |' )
    grdata+=( '#  |                                                                         |' )
    
    echo '# QUADRANT GRAPH RATIO (by filesize) #########################################'
    min="$( echo "scale=9; x=1 - ${MAX_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    max="$( echo "scale=9; x=1 - ${MIN_RATIO}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    min_block="$( echo "scale=9; x=1 - ${MAX_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    max_block="$( echo "scale=9; x=1 - ${MIN_RATIO_BLOCK}; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    
    mingr_h="$(width_itselfl "$(format_ratio "${MAX_RATIO}" 1 )" 8)"
    maxgr_h="$(width_itselfl "$(format_ratio "${MIN_RATIO}" 1 )" 8)"
    
    TESTSID='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghuiklmnopqrstuvwxyz@#$%^&*()";.,'
    
    MIDspeed="$( echo "scale=12; x=${MIN_SPEED}+(${MAX_SPEED} - ${MIN_SPEED} / 2); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    MIDratio="$( echo "scale=12; x=${MIN_RATIO}+(${MAX_RATIO} - ${MIN_RATIO} / 2); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    MIDratio_block="$( echo "scale=12; x=${MIN_RATIO_BLOCK}+(${MIN_RATIO_BLOCK} - ${MIN_RATIO_BLOCK} / 2); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    SPEED_R="$( echo "scale=9; x=${MAX_SPEED} - ${MIN_SPEED}; if(x<0.001) x=0.001; ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
    
    GR_POS=()
    GR_POS_block=()
    GR_val=()
    GR_val_block=()
    GR_W=72
    GR_WM=5
    GR_H=24
    
    #-------- compute arrays for quadrant graphs
    for((i=0; i<${TESTS_COUNT}; i++)); do
      TESTSID_h="$( echo "scale=6; x=(${MAX_SPEED} - ${MIN_SPEED})/${GR_H}; if(x<0.000001) x=0.000001; x=(${RES_SUM_speed[$i]} - ${MIN_SPEED})/x; if(x < 0) x=0; y=${GR_H};  if(x > y) x=y; x=${GR_H}-x; x" | $BCCMD )"
      TESTSID_v="$( echo "scale=6; x=((${max} - ${min})/${GR_W}); if(x<0.000001) x=0.000001; x=((1 - ${RES_SUM_ratio[$i]}) - ${min})/x; x=${GR_W}-x;  if(x < 0) x=0; if(x > ${GR_W}) x=${GR_W}; x=${GR_W}-x + ${GR_WM};  x" | $BCCMD )"
      w="$( echo "scale=6; x=(${GR_H} - ${TESTSID_h})*(${TESTSID_v}*(${GR_H}/${GR_W})); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      TESTSID_h="$( echo "x=${TESTSID_h}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
      TESTSID_v="$( echo "x=${TESTSID_v}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
      GR_POS+=( "${TESTSID_h}"  "${TESTSID_v}" "${TEST_INFO[$i]}" '?' )  
      GR_val+=( "$w" ) 
      TESTSID_h="$( echo "scale=6; x=(${MAX_SPEED} - ${MIN_SPEED})/${GR_H}; if(x<0.000001) x=0.000001; x=(${RES_SUM_speed[$i]} - ${MIN_SPEED})/x; if(x < 0) x=0; y=${GR_H};  if(x > y) x=y; x=${GR_H}-x; x" | $BCCMD )"
      TESTSID_v="$( echo "scale=6; x=((${max_block} - ${min_block})/${GR_W}); if(x<0.000001) x=0.000001; x=((1 - ${RES_SUM_ratio_block[$i]}) - ${min_block})/x; x=${GR_W}-x;  if(x < 0) x=0; if(x > ${GR_W}) x=${GR_W}; x=${GR_W}-x + ${GR_WM};  x" | $BCCMD )"
      w="$( echo "scale=6; x=(${GR_H} - ${TESTSID_h})*(${TESTSID_v}*(${GR_H}/${GR_W})); ${HLP_BC_FORMAT_OUT_NUMBER1}" | $BCCMD )"
      TESTSID_h="$( echo "x=${TESTSID_h}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
      TESTSID_v="$( echo "x=${TESTSID_v}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
      GR_POS_block+=( "${TESTSID_h}"  "${TESTSID_v}" "${TEST_INFO[$i]}" '?' )
      GR_val_block+=( "$w" )
    done
    
    BUBBLE_DESC=0
    bubble_sort "${GR_val[@]}"
    GR_index=(${BUBBLE_RES[@]})
    bubble_sort "${GR_val_block[@]}"
    GR_index_block=(${BUBBLE_RES[@]})
    
    TESTSID_i='0'
    cnt=${#GR_index[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index[$i]}*4))
      TESTSID_h=${GR_POS[$(($index))]}
      TESTSID_v=${GR_POS[$(($index+1))]}
      ch=''
      for((j=0; j<${i}; j++)); do
        index_j=$((${GR_index[$j]}*4))
        TESTSID_h2=${GR_POS[$(($index_j))]}
        TESTSID_v2=${GR_POS[$(($index_j+1))]}
        if [ "$TESTSID_h" -eq "$TESTSID_h2" -a "$TESTSID_v" -eq "$TESTSID_v2" ]; then
          k="$(($index_j+3))"
          ch="${GR_POS[$k]}"
        fi
      done
      if [ -z "${ch}" ]; then
        TESTSID_i="$((${TESTSID_i}+1))"
        ch="${TESTSID:${TESTSID_i}:1}"
      fi
      k="$(($index+3))"
      GR_POS[$k]="$ch"
    done
    
    TESTSID_i='0'
    cnt=${#GR_index_block[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index_block[$i]}*4))
      TESTSID_h=${GR_POS_block[$(($index))]}
      TESTSID_v=${GR_POS_block[$(($index+1))]}
      ch=''
      for((j=0; j<${i}; j++)); do
        index_j=$((${GR_index_block[$j]}*4))
        TESTSID_h2=${GR_POS_block[$(($index_j))]}
        TESTSID_v2=${GR_POS_block[$(($index_j+1))]}
        if [ "$TESTSID_h" -eq "$TESTSID_h2" -a "$TESTSID_v" -eq "$TESTSID_v2" ]; then
          k="$(($index_j+3))"
          ch="${GR_POS_block[$k]}"
        fi
      done
      if [ -z "${ch}" ]; then
        TESTSID_i="$((${TESTSID_i}+1))"
        ch="${TESTSID:${TESTSID_i}:1}"
      fi
      k="$(($index+3))"
      GR_POS_block[$k]="$ch"
    done
    
    grh="#   <<< bad ${mingr_h}             compression ratio          ${maxgr_h} good >>>  "
    grh1="$grh"
    waitforkey2
    H_SPLIT="$( echo "scale=6; x=(1 - ${REPORT_SPEED_W})*${GR_H}; if(x < 0) x=0; y=${GR_H};  if(x > y) x=y; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    V_SPLIT="$( echo "scale=6; x=${REPORT_RATIO_W}*${GR_W}; y=${GR_W}; if(x < 0) x=0; if(x > ${GR_W}) x=${GR_W}; x=x + ${GR_WM}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    V_MIN="$( echo "scale=6; x=((${MAX_RATIO} - ${MIN_RATIO})/${GR_W}); if(x<0.000001) x=0.000001; x=(${REPORT_RATIO_MIN} - ${MIN_RATIO})/x; x=${GR_W}-x;  y=${GR_W}+1; if(x < -1) x=-1; if(x > y) x=y; x=x + ${GR_WM}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    H_MIN="$( echo "scale=12; x=((${MAX_SPEED} - ${MIN_SPEED})/${GR_H}); if(x<0.000001) x=0.000001; x=(${REPORT_SPEED_MIN} - ${MIN_SPEED})/x;  y=${GR_H}+1; if(x < -1) x=-1; if(x > y) x=y; x=${GR_H}-x;  ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD)"
    #print graph
    if [ "${V_MIN}" -eq "${V_SPLIT}" -o "${V_MIN}" -eq "$((${GR_WM}-1))" -o "${V_MIN}" -eq "$((${GR_W} + ${GR_WM}+1))" ]; then
      pair=0
    else
      pair=2
    fi
    data=("${grdata[@]}")
    
    #----- graph background with limits -----------------
    function graphlines(){
      if [ "${H_MIN}" -ge "${GR_H}" ]; then
        grh="${grh//          /  ~~~~~~~ }"
      elif [ "${H_MIN}" -le "-1" ]; then  
        grh1="${grh1//          /  ~~~~~~~ }"
      else	  
        line="${data[${H_MIN}]}"
        line="${line//       /~~~~~~~}"
        line="${line//   /~~~}"
        data[${H_MIN}]="${line}"
      fi  
      cnt=${#grdata[@]}  
      for((i=0; i<${cnt}; i++)); do
        line="${data[$i]}"
        if [ "$i" -eq "${H_SPLIT}" ]; then
          if [ "${H_MIN}" -eq "${H_SPLIT}" ]; then
            line="${line//~~~~~~~~/-~-~-~-~}"
            line="${line//~~~~/-~-~}"
            line="${line//~~/~-}"
          else
            line="${line//       /-------}"
            line="${line//   /---}"
            line="${line:0:$((${V_SPLIT}-1))}|${line:${V_SPLIT}}"
            line="${line:0:$((${V_SPLIT}-1))}+${line:${V_SPLIT}}"
          fi	
        else
         line="${line:0:$((${V_SPLIT}-1))}|${line:${V_SPLIT}}"
        fi
        if [ "${pair}" -lt "2" ]; then
          if [ "${pair}" -eq "0" ]; then
            pair=1
            line="${line:0:$((${V_MIN}-1))}:${line:${V_MIN}}"
          else
            pair=0
          fi  
        else
          line="${line:0:$((${V_MIN}-1))}:${line:${V_MIN}}"
        fi
        data[$i]="${line}"
      done
    }
    graphlines
    echo "$grh"
    
    cnt=${#GR_index[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index[$i]}*4))
      ch="${GR_POS[$(($index+3))]}"
      h=${GR_POS[$(($index))]}
      v=${GR_POS[$(($index+1))]}
      line="${data[$h]}"
      line="${line:0:$(($v-1))}${ch}${line:$v}" 
      data[$h]="${line}"
    done
    
    cnt=${#grdata[@]}  
    for((i=0; i<${cnt}; i++)); do
      if [ "$i" -eq  "$((cnt-1))" ]; then
        echo -n -e "${data[$i]}"
      else
        echo -e "${data[$i]}"
      fi
    done	
    waitforkey
    
    echo ''
    echo "$grh1"
    echo '##############################################################################'
    waitforkey
    
    cnt=${#GR_index[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index[$i]}*4))
      ch="${GR_POS[$(($index+3))]}"
      ch="$( width_itselfl "$ch" "2" )"
      line="${GR_POS[$(($index+2))]}"
      echo "${ch} - ${line}"
    done
    waitforkey
    
    mingr_h="$(width_itselfl "$(format_ratio "${MAX_RATIO_BLOCK}" 1 )" 8)"
    maxgr_h="$(width_itselfl "$(format_ratio "${MIN_RATIO_BLOCK}" 1 )" 8)"
    echo '##############################################################################'
    echo ''
    
    echo '# QUADRANT GRAPH RATIO (by block count) ######################################'
    grh="#   <<< bad ${mingr_h}             compression ratio          ${maxgr_h} good >>>  "
    grh1="$grh"
    waitforkey2
    V_MIN="$( echo "scale=6; x=((${MAX_RATIO_BLOCK} - ${MIN_RATIO_BLOCK})/${GR_W}); if(x<0.000001) x=0.000001; x=(${REPORT_RATIO_MIN} - ${MIN_RATIO_BLOCK})/x; x=${GR_W}-x;  y=${GR_W}+1; if(x < -1) x=-1; if(x > y) x=y; x=x + ${GR_WM}; ${HLP_BC_FORMAT_DIGIT0} x" | $BCCMD )"
    if [ "${V_MIN}" -eq "${V_SPLIT}" -o "${V_MIN}" -eq "$((${GR_WM}-1))" -o "${V_MIN}" -eq "$((${GR_W} + ${GR_WM}+1))" ]; then
      pair=0
    else
      pair=2
    fi
    data=("${grdata[@]}")
    graphlines
    echo "$grh"
    
    cnt=${#GR_index_block[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index_block[$i]}*4))
      ch="${GR_POS_block[$(($index+3))]}"
      h=${GR_POS_block[$(($index))]}
      v=${GR_POS_block[$(($index+1))]}
      line="${data[$h]}"
      line="${line:0:$(($v-1))}${ch}${line:$v}"
      data[$h]="${line}"
    done
    
    cnt=${#grdata[@]} 
    for((i=0; i<${cnt}; i++)); do
      if [ "$i" -eq  "$((cnt-1))" ]; then
        echo -n -e "${data[$i]}"
      else
        echo -e "${data[$i]}"
      fi
    done
    waitforkey
    
    echo ''
    echo "$grh1"
    echo '##############################################################################'
    waitforkey
    
    cnt=${#GR_index_block[@]}
    for((i=0; i<${cnt}; i++)); do
      index=$((${GR_index_block[$i]}*4))
      ch="${GR_POS_block[$(($index+3))]}"
      ch="$( width_itselfl "$ch" "2" )"
      line="${GR_POS_block[$(($index+2))]}"
      echo "${ch} - ${line}"
    done
    echo '##############################################################################'
    
    #clean  -----------------------
    if [ "${LEAVE_COMP}" -eq "0" ]; then
      rmdir "${TMP}/${TMPDIR}"
      if [ "$?" -ne "0" ]; then
        echo "CLEAN ERROR!, error delete '${TMP}/${TMPDIR}' directory." >&2
        exit 2
      fi
    else
      echo ""
      echo "Warning (info):"
      echo " Temoprary directory '${TMP}/${TMPDIR}' contains compressed files." 
    fi  
    
    echo ""
    exit 0
    
    
    Běžné spuštení pro test souborů všemi metodami a jejich kombinacemi:
    find /absolute/path/dir -type f | ./comptest.bash -v -n 42 -w /absolute/path/to/save/dir/result.res -f

    Běžné spuštení pro test adesářů (které si zataruje), jen compresí gz -9, bz-9 a 7z může vypadat nějak takto:
    find /absolute/path/dir -mindepth 1 -maxdepth 1 -type d | ./comptest.bash -v -n 'e0 1 4' -w /absolute/path/to/save/dir/result.res -d

    A případné opakované zobrazení výsledků:
    ./comptest.bash -o /absolute/path/to/save/dir/result.res
    nebo
    ./comptest.bash -o -R 0.8 -S 8388608 /absolute/path/to/save/dir/result.res

    Pro vytvořeni a uchování nejmenšího archivu:
    ./comptest.bash -t /directory/to/save/ -T noexistsdirname -L -n allbest1 -f /full/file/path/name
    nebo pro tar adresáře
    echo /full/dir/path/name | ./comptest.bash -t /directory/to/save/ -T noexistsdirname -L -n allbest1 -d

    …si to vytvoří pomocnou složku (v /tmp , přestavit lze pomocí -t), kam si každý zadaný úkol připraví a otestuje (v případě -L, -l i archiv-y zanechá).
    V případě úkolu 'po souboru' (-i nebo -f) si bere soubor, v případě adreářů (-d) si vytvoří tar ze zadaného adresáře. Zvláštností je, že každý cesta MUSÍ být zadána plná-absolutní (to není bug to je právě feature).
    Umí to vybrat a zanechat nejmenší archiv (-L) nebo případně i všechny (-l). U menších dat nemusí být tak důležitá velikost, ale kolik zabírají bloků, což lze zadat (-b), někdy máme předvolený čas (server se třeba v noci fláká) nebo nás zajímá kompresní poměr, tak je lze zadat (-S -R) a v grafu se pak objeví jako dvojtečkovaná či tildová čára.
    Výsledky si lze uložit do souboru (-w) a pak opět načíst (-o), ale nelze pak už změnit velikost bloku…
    -w je dobré použít, uloží to údaje po každém testovaném soouboru a tedy i když se to pak zeštřelí, bo nás už nebaví na to čekat, tak něco z toho je.
    (Pokud se to udělá kill <PID toho testu>, snad se to zestřelí až po skončení právě testovaného souboru - po všech vybraných kompresích.)

    Tady je pár zbytečností či zajímavostí, ke ketrým jsme došel.

    Výsledek z různých specifckých dat (80 adresářů/vzorků celkem do 15GiB), kde 20 % dole považuji za účelné (rcyhlost není důležitá, ale je hezky vidět jak je gzip rychlý):
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  82.41 %             compression ratio           74.80 % good >>>  
    #  |             1         :            |                                    |
    # ^|                       :            |                                    |
    # ^|                       :            |                                    |
    # ^|                       :            |                                    |
    #  |                       :            |                                    |
    # f|                       :            |                                    |
    # a|                       :            |                                    |
    # s|                       :            |                                    |
    # t|                       :            |                                    |
    #  |                       :            |                                    |
    # s|                       :            |                                    |
    # p|                       :            |                                    |
    # e|-----------------------:------------+------------------------------------|
    # e|                       :            |                                    |
    # d|                       :            |                                    |
    #  |                       :            |                                    |
    # s|                       :            |                                    |
    # l|7                  4   :            |                                    |
    # o|                       :            |                                    |
    # w|~~~~~~~~~~~~5~~~~~~~~~~:~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    #  | 8                     :            |                                   2|
    # v|                       :            |                                    |
    # v| B                     :            |                                 3  |
    # v| D          9          :            |                                6   |
    #  |               C       :            |                                A   |
    #   <<< bad  82.41 %             compression ratio           74.80 % good >>>  
    ##############################################################################
     1 - [ gz -9                ] S:    9.49 MiB/sec; R:  81.09 %; RB:  81.09 %
     2 - [ 7z.gz -txz -9        ] S:    3.65 MiB/sec; R:  74.80 %; RB:  74.80 %
     3 - [ 7z                   ] S:    3.15 MiB/sec; R:  75.05 %; RB:  75.05 %
     4 - [ gz.7z -txz -9        ] S:    4.39 MiB/sec; R:  80.41 %; RB:  80.41 %
     5 - [ gz.bz2 -9 -9         ] S:    4.02 MiB/sec; R:  81.12 %; RB:  81.12 %
     6 - [ 7z.bz2 -txz -9       ] S:    2.71 MiB/sec; R:  75.14 %; RB:  75.14 %
     7 - [ bz2 -9               ] S:    4.40 MiB/sec; R:  82.41 %; RB:  82.41 %
     8 - [ bz2.gz -9 -9         ] S:    3.71 MiB/sec; R:  82.34 %; RB:  82.34 %
     9 - [ gz.bz2.7z -9 -9 -txz ] S:    2.79 MiB/sec; R:  81.12 %; RB:  81.12 %
     A - [ 7z.gz.bz2 -txz -9 -9 ] S:    2.54 MiB/sec; R:  75.15 %; RB:  75.15 %
     B - [ bz2.7z -9 -txz       ] S:    2.95 MiB/sec; R:  82.33 %; RB:  82.33 %
     C - [ gz.7z.bz2 -9 -txz -9 ] S:    2.61 MiB/sec; R:  80.79 %; RB:  80.79 %
     D - [ bz2.gz.7z -9 -9 -txz ] S:    2.72 MiB/sec; R:  82.35 %; RB:  82.35 %
     D - [ bz2.7z.gz -9 -txz -9 ] S:    2.71 MiB/sec; R:  82.32 %; RB:  82.32 %
     A - [ 7z.bz2.gz -txz -9 -9 ] S:    2.47 MiB/sec; R:  75.14 %; RB:  75.14 %
    ##############################################################################
    
    Tady například velmi neefektivní stl data v ASCII verzi.
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  15.06 %             compression ratio            8.47 % good >>>  
    #  :       6                            |                                    |
    # ^|                                    |                                    |
    # ^:8                                   |                                    |
    # ^|           5                        |                                    |
    #  :                                    |                                    |
    # f|                                    |                                    |
    # a:                                    |                                    |
    # s|                                    |                                    |
    # t:                                    |                                    |
    #  |                                    |                                    |
    # s:                        3           |                                    |
    # p|                                 1  |                                    |
    # e:------------------------------------+------------------------------------|
    # e|                                    |  2                                 |
    # d:                                    |                                    |
    #  |                                    |                                    |
    # s:                                    |    4                               |
    # l|                                    |                                    |
    # o:                                    |                                    |
    # w|                                    |                                    |
    #  :                                    |                                    |
    # v|                                    |       7                            |
    # v:                                    |       9                            |
    # v|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~C~~~~~A~~~E~BD~~FG~~~~~~~~~~~|
    #  :                                    |                        H         JI|
    #   <<< bad  15.06 %             compression ratio            8.47 % good >>>  
    ##############################################################################
     1 - [ gz -5                ] S:   33.05 MiB/sec; R:  11.95 %; RB:  12.04 %
     2 - [ gz -6                ] S:   27.12 MiB/sec; R:  11.38 %; RB:  11.50 %
     3 - [ gz -4                ] S:   35.60 MiB/sec; R:  12.82 %; RB:  12.91 %
     4 - [ gz -7                ] S:   21.74 MiB/sec; R:  11.21 %; RB:  11.30 %
     5 - [ gz -3                ] S:   51.91 MiB/sec; R:  13.99 %; RB:  14.06 %
     6 - [ gz -2                ] S:   58.15 MiB/sec; R:  14.39 %; RB:  14.46 %
     7 - [ gz -8                ] S:    9.84 MiB/sec; R:  10.96 %; RB:  11.03 %
     8 - [ gz -1                ] S:   53.10 MiB/sec; R:  14.98 %; RB:  15.06 %
     9 - [ gz.7z -txz -9        ] S:    7.31 MiB/sec; R:  10.96 %; RB:  11.03 %
     9 - [ gz.bz2 -9 -9         ] S:    7.21 MiB/sec; R:  11.01 %; RB:  11.03 %
     9 - [ gz -9                ] S:    6.51 MiB/sec; R:  10.95 %; RB:  11.03 %
     A - [ bz2 -1               ] S:    5.34 MiB/sec; R:  10.38 %; RB:  10.49 %
     9 - [ gz.bz2.7z -9 -9 -txz ] S:    5.66 MiB/sec; R:  11.02 %; RB:  11.03 %
     B - [ bz2 -3               ] S:    4.91 MiB/sec; R:   9.84 %; RB:   9.95 %
     C - [ gz.7z.bz2 -9 -txz -9 ] S:    5.44 MiB/sec; R:  11.02 %; RB:  11.03 %
     D - [ bz2 -5               ] S:    4.62 MiB/sec; R:   9.73 %; RB:   9.82 %
     D - [ bz2 -4               ] S:    4.55 MiB/sec; R:   9.76 %; RB:   9.82 %
     E - [ bz2 -2               ] S:    4.70 MiB/sec; R:  10.02 %; RB:  10.15 %
     F - [ bz2 -7               ] S:    4.18 MiB/sec; R:   9.54 %; RB:   9.62 %
     G - [ bz2.gz -9 -9         ] S:    3.86 MiB/sec; R:   9.45 %; RB:   9.48 %
     G - [ bz2.7z -9 -txz       ] S:    3.79 MiB/sec; R:   9.46 %; RB:   9.48 %
     F - [ bz2 -6               ] S:    3.77 MiB/sec; R:   9.56 %; RB:   9.62 %
     G - [ bz2 -9               ] S:    3.63 MiB/sec; R:   9.46 %; RB:   9.48 %
     G - [ bz2.7z.gz -9 -txz -9 ] S:    3.59 MiB/sec; R:   9.45 %; RB:   9.48 %
     F - [ bz2 -8               ] S:    3.49 MiB/sec; R:   9.55 %; RB:   9.62 %
     H - [ bz2.gz.7z -9 -9 -txz ] S:    3.15 MiB/sec; R:   9.45 %; RB:   9.48 %
     I - [ 7z.gz -txz -9        ] S:    2.87 MiB/sec; R:   8.40 %; RB:   8.47 %
     I - [ 7z                   ] S:    2.49 MiB/sec; R:   8.40 %; RB:   8.47 %
     J - [ 7z.bz2 -txz -9       ] S:    2.45 MiB/sec; R:   8.45 %; RB:   8.54 %
     J - [ 7z.bz2.gz -txz -9 -9 ] S:    2.43 MiB/sec; R:   8.45 %; RB:   8.54 %
     J - [ 7z.gz.bz2 -txz -9 -9 ] S:    2.15 MiB/sec; R:   8.46 %; RB:   8.54 %
    ##############################################################################
    
    Oproti stl v binárním formátu, kde 7z jasně vede (ne, že by na tom byl v předchozím nějak špatně, ale tak jasné to nebylo)
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  38.67 %             compression ratio           20.10 % good >>>  
    #  :          3                         |                                    |
    # ^|                                    |                                    |
    # ^:                                    |                                    |
    # ^|             2                      |                                    |
    #  :                                    |                                    |
    # f|             5                      |                                    |
    # a:                                    |                                    |
    # s|                   1                |                                    |
    # t:                                    |                                    |
    #  |                                    |                                    |
    # s:                    4               |                                    |
    # p|                                    |                                    |
    # e:------------------------------------+------------------------------------|
    # e|                    6               |                                    |
    # d:                                    |                                    |
    #  |                    7               |                                    |
    # s:                                    |                                    |
    # l|                                    |                                    |
    # o:                                    |                                    |
    # w|                    8               |                                    |
    #  :O   I  F                            |                                    |
    # v|        EG D        9               |                                    |
    # v:~~~~~~~~JL~~K~~~~~~~~~~~~~~~~~~A~~B~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # v|           M                   C H  |                                    |
    #  :                                    |                                   N|
    #   <<< bad  38.67 %             compression ratio           20.10 % good >>>  
    ##############################################################################
     1 - [ gz -4                ] S:   23.50 MiB/sec; R:  33.80 %; RB:  33.86 %
     2 - [ gz -2                ] S:   28.88 MiB/sec; R:  35.27 %; RB:  35.33 %
     3 - [ gz -1                ] S:   32.63 MiB/sec; R:  35.93 %; RB:  36.01 %
     4 - [ gz -5                ] S:   19.94 MiB/sec; R:  33.49 %; RB:  33.56 %
     5 - [ gz -3                ] S:   26.72 MiB/sec; R:  35.30 %; RB:  35.36 %
     6 - [ gz -6                ] S:   16.11 MiB/sec; R:  33.46 %; RB:  33.51 %
     7 - [ gz -7                ] S:   13.10 MiB/sec; R:  33.41 %; RB:  33.47 %
     8 - [ gz -8                ] S:    7.69 MiB/sec; R:  33.31 %; RB:  33.39 %
     9 - [ gz -9                ] S:    5.88 MiB/sec; R:  33.31 %; RB:  33.39 %
     A - [ gz.bz2 -9 -9         ] S:    4.33 MiB/sec; R:  30.61 %; RB:  30.71 %
     B - [ gz.7z -txz -9        ] S:    3.65 MiB/sec; R:  29.89 %; RB:  29.98 %
     C - [ gz.bz2.7z -9 -9 -txz ] S:    3.29 MiB/sec; R:  30.61 %; RB:  30.71 %
     D - [ bz2.gz -9 -9         ] S:    5.23 MiB/sec; R:  35.65 %; RB:  35.72 %
     E - [ bz2 -5               ] S:    5.86 MiB/sec; R:  36.49 %; RB:  36.55 %
     F - [ bz2 -4               ] S:    6.09 MiB/sec; R:  36.71 %; RB:  36.80 %
     E - [ bz2 -7               ] S:    5.67 MiB/sec; R:  36.42 %; RB:  36.50 %
     G - [ bz2 -8               ] S:    5.57 MiB/sec; R:  36.39 %; RB:  36.46 %
     F - [ bz2 -3               ] S:    6.17 MiB/sec; R:  36.94 %; RB:  36.99 %
     H - [ gz.7z.bz2 -9 -txz -9 ] S:    2.63 MiB/sec; R:  30.04 %; RB:  30.13 %
     I - [ bz2 -2               ] S:    6.09 MiB/sec; R:  37.63 %; RB:  37.66 %
     J - [ bz2 -6               ] S:    4.63 MiB/sec; R:  36.60 %; RB:  36.66 %
     K - [ bz2.7z.gz -9 -txz -9 ] S:    3.85 MiB/sec; R:  35.63 %; RB:  35.70 %
     L - [ bz2 -9               ] S:    4.30 MiB/sec; R:  36.30 %; RB:  36.38 %
     M - [ bz2.7z -9 -txz       ] S:    3.28 MiB/sec; R:  35.65 %; RB:  35.74 %
     M - [ bz2.gz.7z -9 -9 -txz ] S:    3.25 MiB/sec; R:  35.65 %; RB:  35.72 %
     N - [ 7z.gz -txz -9        ] S:    1.80 MiB/sec; R:  20.00 %; RB:  20.10 %
     N - [ 7z                   ] S:    1.79 MiB/sec; R:  20.02 %; RB:  20.10 %
     O - [ bz2 -1               ] S:    6.07 MiB/sec; R:  38.63 %; RB:  38.67 %
     N - [ 7z.bz2 -txz -9       ] S:    1.64 MiB/sec; R:  20.11 %; RB:  20.21 %
     N - [ 7z.gz.bz2 -txz -9 -9 ] S:    1.57 MiB/sec; R:  20.11 %; RB:  20.21 %
     N - [ 7z.bz2.gz -txz -9 -9 ] S:    1.41 MiB/sec; R:  20.11 %; RB:  20.21 %
    ##############################################################################
    
    Oproti tomu jak se mu na specifických TIFF souborech až tak nedařilo (a na Jpeg souborech generoval decompresi místo comprese - zvětšoval filesy).
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  82.40 %             compression ratio           66.49 % good >>>  
    #  |    B      :                        |                                    |
    # ^|      A    :                        |                                    |
    # ^|      8    :                        |                                    |
    # ^|           :                        |                                    |
    #  |           :                        |                                    |
    # f|  C        :                        |                                    |
    # a| E         :                        |                                    |
    # s|  D        :                        |                                    |
    # t|  F        :                        |                                    |
    #  |           :                        |                                    |
    # s|           :                        |                                    |
    # p|           :                        |                                    |
    # e|-----------:------------------------+------------------------------------|
    # e|           :                        |                                    |
    # d|           :                        |                                    |
    #  |           :                        |                                    |
    # s|           :                        |                                    |
    # l|           :                        |                                 312|
    # o|           :                        |                             6    54|
    # w|           :                        |                                  7 |
    #  |~~H~~~~~~~~:~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # v|I          :                        |                                  9 |
    # v|           :                        |                                    |
    # v|K          :                        |                         G          |
    #  |           :                        |                       J            |
    #   <<< bad  82.40 %             compression ratio           66.49 % good >>>  
    ##############################################################################
     1 - [ bz2 -3               ] S:    5.39 MiB/sec; R:  66.61 %; RB:  66.65 %
     2 - [ bz2 -5               ] S:    5.27 MiB/sec; R:  66.51 %; RB:  66.53 %
     3 - [ bz2 -2               ] S:    5.31 MiB/sec; R:  66.89 %; RB:  66.94 %
     4 - [ bz2 -6               ] S:    5.11 MiB/sec; R:  66.49 %; RB:  66.52 %
     4 - [ bz2 -4               ] S:    5.06 MiB/sec; R:  66.46 %; RB:  66.49 %
     4 - [ bz2 -8               ] S:    4.98 MiB/sec; R:  66.54 %; RB:  66.58 %
     5 - [ bz2 -9               ] S:    4.88 MiB/sec; R:  66.63 %; RB:  66.67 %
     4 - [ bz2 -7               ] S:    4.80 MiB/sec; R:  66.53 %; RB:  66.57 %
     6 - [ bz2 -1               ] S:    4.81 MiB/sec; R:  67.77 %; RB:  67.81 %
     7 - [ bz2.gz -9 -9         ] S:    4.15 MiB/sec; R:  66.62 %; RB:  66.66 %
     8 - [ gz -3                ] S:   14.64 MiB/sec; R:  80.95 %; RB:  80.98 %
     9 - [ bz2.7z -9 -txz       ] S:    3.34 MiB/sec; R:  66.63 %; RB:  66.68 %
     A - [ gz -2                ] S:   14.90 MiB/sec; R:  81.13 %; RB:  81.15 %
     9 - [ bz2.7z.gz -9 -txz -9 ] S:    3.22 MiB/sec; R:  66.63 %; RB:  66.67 %
     B - [ gz -1                ] S:   15.52 MiB/sec; R:  81.38 %; RB:  81.42 %
     9 - [ bz2.gz.7z -9 -9 -txz ] S:    3.07 MiB/sec; R:  66.63 %; RB:  66.67 %
     C - [ gz -5                ] S:   12.55 MiB/sec; R:  82.05 %; RB:  82.06 %
     D - [ gz -7                ] S:   11.44 MiB/sec; R:  82.01 %; RB:  82.05 %
     E - [ gz -4                ] S:   12.19 MiB/sec; R:  82.12 %; RB:  82.17 %
     F - [ gz -9                ] S:   11.10 MiB/sec; R:  82.00 %; RB:  82.03 %
     F - [ gz -6                ] S:   10.96 MiB/sec; R:  82.02 %; RB:  82.05 %
     F - [ gz -8                ] S:   10.78 MiB/sec; R:  82.01 %; RB:  82.04 %
     G - [ 7z                   ] S:    2.25 MiB/sec; R:  68.73 %; RB:  68.79 %
     G - [ 7z.gz -txz -9        ] S:    2.16 MiB/sec; R:  68.75 %; RB:  68.80 %
     H - [ gz.7z -txz -9        ] S:    3.99 MiB/sec; R:  82.01 %; RB:  82.03 %
     I - [ gz.bz2 -9 -9         ] S:    2.96 MiB/sec; R:  82.36 %; RB:  82.40 %
     J - [ 7z.gz.bz2 -txz -9 -9 ] S:    1.55 MiB/sec; R:  69.07 %; RB:  69.11 %
     J - [ 7z.bz2 -txz -9       ] S:    1.53 MiB/sec; R:  69.06 %; RB:  69.09 %
     K - [ gz.bz2.7z -9 -9 -txz ] S:    2.13 MiB/sec; R:  82.36 %; RB:  82.40 %
     K - [ gz.7z.bz2 -9 -txz -9 ] S:    2.02 MiB/sec; R:  82.36 %; RB:  82.40 %
     J - [ 7z.bz2.gz -txz -9 -9 ] S:    1.46 MiB/sec; R:  69.06 %; RB:  69.10 %
    ##############################################################################
    
    Ale zase na zdrojácích (c++)
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  30.87 %             compression ratio           17.80 % good >>>  
    #  :7                                   |                                    |
    # ^|                                    |                                    |
    # ^:                                    |                                    |
    # ^|   6                                |                                    |
    #  :                                    |                                    |
    # f|     4                              |                                    |
    # a:                                    |                                    |
    # s|        2                           |                                    |
    # t:                                    |                                    |
    #  |           1                        |                                    |
    # s:                                    |                                    |
    # p|                                    |                                    |
    # e:------------------------------------+------------------------------------|
    # e|            3                       |                                    |
    # d:             5                      |                                    |
    #  |                                    |                                    |
    # s:                                    |                                    |
    # l|                                    |                                    |
    # o:                                    |                                    |
    # w|              8                     |                                    |
    #  :                                    |                                    |
    # v|                                    |                                    |
    # v:~~~~~~~~~~~~~~G~~~~~~~~B~~9ACD~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # v|              J       KH     EF     |                                    |
    #  :              M               I     |                                   L|
    #   <<< bad  30.87 %             compression ratio           17.80 % good >>>  
    ##############################################################################
     1 - [ gz -5                ] S:   22.08 MiB/sec; R:  28.90 %; RB:  28.90 %
     2 - [ gz -4                ] S:   25.01 MiB/sec; R:  29.39 %; RB:  29.39 %
     3 - [ gz -6                ] S:   16.91 MiB/sec; R:  28.62 %; RB:  28.62 %
     4 - [ gz -3                ] S:   26.84 MiB/sec; R:  29.94 %; RB:  29.95 %
     5 - [ gz -7                ] S:   15.07 MiB/sec; R:  28.52 %; RB:  28.52 %
     6 - [ gz -2                ] S:   30.40 MiB/sec; R:  30.40 %; RB:  30.40 %
     7 - [ gz -1                ] S:   33.94 MiB/sec; R:  30.86 %; RB:  30.87 %
     8 - [ gz -8                ] S:    8.39 MiB/sec; R:  28.37 %; RB:  28.37 %
     9 - [ bz2 -2               ] S:    5.03 MiB/sec; R:  26.20 %; RB:  26.21 %
     A - [ bz2 -3               ] S:    4.70 MiB/sec; R:  26.00 %; RB:  26.00 %
     B - [ bz2 -1               ] S:    4.95 MiB/sec; R:  26.66 %; RB:  26.66 %
     C - [ bz2 -4               ] S:    4.39 MiB/sec; R:  25.86 %; RB:  25.86 %
     C - [ bz2 -5               ] S:    4.02 MiB/sec; R:  25.78 %; RB:  25.78 %
     D - [ bz2 -7               ] S:    3.93 MiB/sec; R:  25.63 %; RB:  25.63 %
     C - [ bz2 -6               ] S:    3.91 MiB/sec; R:  25.70 %; RB:  25.70 %
     E - [ bz2 -8               ] S:    3.77 MiB/sec; R:  25.60 %; RB:  25.60 %
     F - [ bz2.gz -9 -9         ] S:    3.22 MiB/sec; R:  25.44 %; RB:  25.44 %
     F - [ bz2 -9               ] S:    3.11 MiB/sec; R:  25.49 %; RB:  25.49 %
     G - [ gz -9                ] S:    4.00 MiB/sec; R:  28.33 %; RB:  28.33 %
     F - [ bz2.gz.7z -9 -9 -txz ] S:    2.51 MiB/sec; R:  25.44 %; RB:  25.44 %
     F - [ bz2.7z.gz -9 -txz -9 ] S:    2.49 MiB/sec; R:  25.44 %; RB:  25.44 %
     H - [ gz.7z -txz -9        ] S:    2.66 MiB/sec; R:  26.76 %; RB:  26.76 %
     I - [ bz2.7z -9 -txz       ] S:    2.38 MiB/sec; R:  25.44 %; RB:  25.45 %
     J - [ gz.bz2 -9 -9         ] S:    2.85 MiB/sec; R:  28.31 %; RB:  28.32 %
     K - [ gz.7z.bz2 -9 -txz -9 ] S:    2.48 MiB/sec; R:  26.87 %; RB:  26.88 %
     L - [ 7z.gz -txz -9        ] S:    1.97 MiB/sec; R:  17.80 %; RB:  17.80 %
     L - [ 7z                   ] S:    1.90 MiB/sec; R:  17.84 %; RB:  17.84 %
     M - [ gz.bz2.7z -9 -9 -txz ] S:    2.22 MiB/sec; R:  28.31 %; RB:  28.32 %
     L - [ 7z.bz2 -txz -9       ] S:    1.83 MiB/sec; R:  17.88 %; RB:  17.88 %
     L - [ 7z.bz2.gz -txz -9 -9 ] S:    1.79 MiB/sec; R:  17.88 %; RB:  17.88 %
     L - [ 7z.gz.bz2 -txz -9 -9 ] S:    1.77 MiB/sec; R:  17.88 %; RB:  17.88 %
    ##############################################################################
    
    Jinak na VMWare adresáře virtuálních strojů je 7z i 10 % efektivnější než bz2 či gz.

    Když nic, tak jsem si opět připoměl, že minimálně za − (minus) pro bc je vhodné dávat mezeru, protože XY=-5; echo "10-${XY}" | bc to nesežere.

    A fčul hurá na bramborový salát… (vyrobit, ne zlikvidovat…)        

    Hodnocení: 89 %

            špatnédobré        

    Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

    Komentáře

    Vložit další komentář

    dolik.rce avatar 23.12.2012 16:58 dolik.rce
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Jinak na VMWare adresáře virtuálních strojů je 7z i 10 % efektivnější než bz2 či gz.

    Jestli si dobre pamatuju, tak je to tim ze 7z u kazdeho souboru testne jestli nejsou komprimovana data delsi nez nekomprimovana a pokud jo, tak ulozi do archivu ty nekomprimovana. Takze pokud je tam smeska ruznych typu souboru, muze to mit velmi pozitivni ucinek na vyslednou velikost.
    23.12.2012 19:12 Radovan Garabík
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Zaujímavé by bolo porovnať aj rzip, prípadne lrzip (a možno aj xz/lzip, ale tam budú asi výsledky o niečo horšie ako 7zip)
    23.12.2012 21:00 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Asi je to zajímavá myšlenka (jsem to doplnil - ten script, kdyby to někdo chtěl, tak sem dám znovu),
    C++ zdrojáky:
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  28.33 %             compression ratio           16.58 % good >>>  
    #  :2                                   |                                    |
    # ^|                                    |                                    |
    # ^:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # ^|                                    |                                    |
    #  :                                    |                                    |
    # f|                                    |                                    |
    # a:                                    |                                    |
    # s|                 1                  |                                    |
    # t:                                    |                                    |
    #  |                                    |                                    |
    # s:                                    |                                    |
    # p|                                    |                                    |
    # e:------------------------------------+------------------------------------|
    # e|                                    |                                    |
    # d:                                    |                                    |
    #  |                                    |                                    |
    # s:                                    |                                    |
    # l|                                    |                                    |
    # o:                                    |                                    |
    # w|                                    |                                    |
    #  :                                    |                                    |
    # v|                                    |                                    |
    # v:                                    |                                    |
    # v|                                    |                                    |
    #  :                                    |                      4            3|
    #   <<< bad  28.33 %             compression ratio           16.58 % good >>>  
    ##############################################################################
     1 - [ bz2 -9               ] S:    3.42 MiB/sec; R:  25.49 %; RB:  25.49 %
     2 - [ gz -9                ] S:    4.27 MiB/sec; R:  28.33 %; RB:  28.33 %
     3 - [ lrzip -L 9           ] S:    1.38 MiB/sec; R:  16.58 %; RB:  16.58 %
     4 - [ rzip -9              ] S:    1.37 MiB/sec; R:  18.68 %; RB:  18.68 %
    ##############################################################################
    
    STL soubory (binární):
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  36.38 %             compression ratio           20.46 % good >>>  
    #  :              1                     |                                    |
    # ^|                                    |                                    |
    # ^:                                    |                                    |
    # ^|2                                   |                                    |
    #  :                                    |                                    |
    # f|                                    |                                    |
    # a:                                    |                                    |
    # s|                                    |                                    |
    # t:                                    |                                    |
    #  |                                    |                                    |
    # s:                                    |                                    |
    # p|                                    |                                    |
    # e:------------------------------------+------------------------------------|
    # e|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # d:                                    |                                    |
    #  |                                    |                                    |
    # s:                                    |                                    |
    # l|                                    |                                    |
    # o:                                    |                                    |
    # w|3                                   |                                    |
    #  :                                    |                                    |
    # v|                                    |                                    |
    # v:                                    |                                    |
    # v|                                    |                                    |
    #  :                                    |                                   4|
    #   <<< bad  36.38 %             compression ratio           20.46 % good >>>  
    ##############################################################################
     1 - [ gz -9                ] S:    7.02 MiB/sec; R:  33.31 %; RB:  33.39 %
     2 - [ bz2 -9               ] S:    6.28 MiB/sec; R:  36.30 %; RB:  36.38 %
     3 - [ rzip -9              ] S:    2.52 MiB/sec; R:  36.26 %; RB:  36.34 %
     4 - [ lrzip -L 9           ] S:    1.41 MiB/sec; R:  20.38 %; RB:  20.46 %
    ##############################################################################
    
    Virtuály zatím nemám :(, to chvíli trvá…
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†
    24.12.2012 12:32 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Tady je výsledek na několika adresářích VMWare strojů (Win i Linux)
    (každý stroj balený zvlášť, v duchu scriptu '-d'):
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad  40.37 %             compression ratio           25.89 % good >>>  
    #  :3                                   |                                    |
    # ^|                                    |                                    |
    # ^:                                    |                                    |
    # ^|                                    |                                    |
    #  :                                    |                                    |
    # f|                                    |                                    |
    # a:                                    |                                    |
    # s|                                    |                                    |
    # t:                                    |                                    |
    #  |         2                          |                                    |
    # s:                                    |                                    |
    # p|                                    |                                    |
    # e:------------------------------------+------------------------------------|
    # e|                                    |                                    |
    # d:                                    |                                    |
    #  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    # s:                                    |                                    |
    # l|                                    |    1                               |
    # o:                                    |                                    |
    # w|                                    |                                    |
    #  :                                    |                                    |
    # v|                                    |                                    |
    # v:                                    |                                    |
    # v|                                    |                                    |
    #  :                                    |                                   4|
    #   <<< bad  40.37 %             compression ratio           25.89 % good >>>  
    ##############################################################################
     1 - [ rzip -9              ] S:    3.79 MiB/sec; R:  32.03 %; RB:  32.03 %
     2 - [ bz2 -9               ] S:    4.79 MiB/sec; R:  38.55 %; RB:  38.55 %
     3 - [ gz -9                ] S:    5.89 MiB/sec; R:  40.37 %; RB:  40.37 %
     4 - [ lrzip -L 9           ] S:    2.95 MiB/sec; R:  25.89 %; RB:  25.89 %
    ##############################################################################
    
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†
    23.12.2012 19:45 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Pokud by tomu tak bylo, tak by to minimálně znamenalo, že má rozšafnou hlavičku protože u běžných jpeg-ů (370ks co mám z běžného staršího 5MPixelu):
    # QUADRANT GRAPH RATIO (by block count) ######################################
    #   <<< bad 100.25 %             compression ratio           99.17 % good >>>  
    #  |                                    |    1                               :
    # ^|                                    |                                    |
    # ^|                                    |   2                                :
    # ^|                                    |  4                                 |
    #  |                                    |  53                                :
    # f|                                    |                                    |
    # a|                                    |                                    :
    # s|                                    |  6                                 |
    # t|                                    |                                    :
    #  |                                    |  7                                 |
    # s|                                    |                                    :
    # p|                                    |  8                                 |
    # e|------------------------------------+------------------------------------:
    # e|                                    |                                    |
    # d|                                    |  9                                 :
    #  |                                    |                                    |
    # s|                                    |                                    :
    # l|                                    |                                    |
    # o|                                    |                                    :
    # w|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    #  |                                    |    H       D      C          A     :
    # v|                      M             |                       E   G     B F|
    # v|O                                   |LKI                                 :
    # v|                                    | N                                 J|
    #  |                                    |PQ                   R              :
    #   <<< bad 100.25 %             compression ratio           99.17 % good >>>  
    ##############################################################################
     1 - [ gz -3                ] S:   14.14 MiB/sec; R:  99.65 %; RB:  99.65 %
     2 - [ gz -2                ] S:   13.27 MiB/sec; R:  99.65 %; RB:  99.65 %
     3 - [ gz -1                ] S:   12.20 MiB/sec; R:  99.66 %; RB:  99.66 %
     4 - [ gz -6                ] S:   12.32 MiB/sec; R:  99.68 %; RB:  99.67 %
     5 - [ gz -8                ] S:   12.09 MiB/sec; R:  99.68 %; RB:  99.67 %
     6 - [ gz -4                ] S:   10.59 MiB/sec; R:  99.68 %; RB:  99.67 %
     7 - [ gz -9                ] S:    9.28 MiB/sec; R:  99.68 %; RB:  99.67 %
     8 - [ gz -7                ] S:    8.23 MiB/sec; R:  99.68 %; RB:  99.67 %
     9 - [ gz -5                ] S:    6.84 MiB/sec; R:  99.68 %; RB:  99.67 %
     A - [ bz2 -7               ] S:    3.62 MiB/sec; R:  99.25 %; RB:  99.25 %
     B - [ bz2 -8               ] S:    3.25 MiB/sec; R:  99.21 %; RB:  99.21 %
     C - [ bz2 -4               ] S:    3.50 MiB/sec; R:  99.42 %; RB:  99.42 %
     D - [ bz2 -3               ] S:    3.73 MiB/sec; R:  99.51 %; RB:  99.51 %
     E - [ bz2 -5               ] S:    3.19 MiB/sec; R:  99.36 %; RB:  99.36 %
     F - [ bz2 -9               ] S:    2.90 MiB/sec; R:  99.18 %; RB:  99.17 %
     F - [ bz2.gz -9 -9         ] S:    2.80 MiB/sec; R:  99.17 %; RB:  99.17 %
     G - [ bz2 -6               ] S:    2.85 MiB/sec; R:  99.30 %; RB:  99.30 %
     H - [ bz2 -2               ] S:    3.50 MiB/sec; R:  99.65 %; RB:  99.64 %
     I - [ gz.bz2 -9 -9         ] S:    2.71 MiB/sec; R:  99.68 %; RB:  99.67 %
     J - [ bz2.7z.gz -9 -txz -9 ] S:    2.17 MiB/sec; R:  99.18 %; RB:  99.18 %
     K - [ gz.7z -txz -9        ] S:    2.69 MiB/sec; R:  99.68 %; RB:  99.68 %
     L - [ 7z.gz -txz -9        ] S:    2.67 MiB/sec; R:  99.70 %; RB:  99.70 %
     M - [ bz2 -1               ] S:    3.29 MiB/sec; R:  99.92 %; RB:  99.92 %
     J - [ bz2.7z -9 -txz       ] S:    2.07 MiB/sec; R:  99.18 %; RB:  99.18 %
     J - [ bz2.gz.7z -9 -9 -txz ] S:    1.97 MiB/sec; R:  99.18 %; RB:  99.18 %
     N - [ gz.bz2.7z -9 -9 -txz ] S:    1.86 MiB/sec; R:  99.68 %; RB:  99.68 %
     O - [ 7z                   ] S:    2.65 MiB/sec; R: 100.25 %; RB: 100.25 %
     P - [ 7z.gz.bz2 -txz -9 -9 ] S:    1.61 MiB/sec; R:  99.70 %; RB:  99.70 %
     Q - [ gz.7z.bz2 -9 -txz -9 ] S:    1.59 MiB/sec; R:  99.68 %; RB:  99.68 %
     R - [ 7z.bz2 -txz -9       ] S:    1.53 MiB/sec; R:  99.39 %; RB:  99.39 %
     R - [ 7z.bz2.gz -txz -9 -9 ] S:    1.48 MiB/sec; R:  99.39 %; RB:  99.39 %
    ##############################################################################
    
    7zip soubory zvětšuje
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†
    23.12.2012 20:51 w4rr10r
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Nevím, kdo tě učil skloňovat, ale nenaučil tě to. "bash-i" apod. fakt není dobře.
    23.12.2012 21:03 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Vidiš a já su přesvědčený, že je…
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†
    23.12.2012 23:24 w4rr10r
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Jistě to podpoříš argumentem, a sice nejlépe odkazem na výjimku z pravidel českého pravopisu, která o takové grafické úpravě skloňování přejatých slov a jmen hovoří. Tvrdím, že taková úprava nejen neexistuje, ale navíc to vypadá nechutně.
    24.12.2012 12:28 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Nepodpořím. A je mi jedno co existuje či neexistuje, přijde mi to jako nejlepší kompromis a nyní je na pravidlech, aby se do mé úpravy vyvinula ;). Sice mě mrzí, že Tě to irituje, za což se Ti omlouvám, ale s trochou tolerance nebo ignorace to lze zvládnout…
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†
    26.12.2012 14:35 falešný amig4poשer
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Taková úprava existuje, stačí si přečíst tento blog. A nechutnej seš ty, tak neremcej :)
    Josef Kufner avatar 23.12.2012 23:29 Josef Kufner | skóre: 68
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Tyhle věci se nechávají bez skloňování. Stejně jako například číslovky psané číslicemi.
    Hello world ! Segmentation fault (core dumped)
    24.12.2012 03:15 imploder | skóre: 11
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Jako že správně by to mělo být všude v 1. pádě (v bash)? To mi teda rozhodně správné nepřipadá.
    24.12.2012 08:49 jekub
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    můžete o tom pochybovat, můžete proti tom protestovat, ale ...
    24.12.2012 09:54 Václav HFechs Švirga | skóre: 26 | blog: HF | Kopřivnice
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Souhlasím, možná je to správné, ale zato dementní (dle mého názoru) :-D. Kdo nehrotí normy a netrápí ho pohoršené pohledy puristů, nemá problém ;-). Ale napsal bych v bashi.
    Baník pyčo!
    24.12.2012 13:11 Xerces
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Ne. Správně by mělo být ... v bashu ... protože BASH = Bourne-Again SHell a tedy v Bourne-Again SHellu. :-]
    24.12.2012 14:07 tom
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Zkratkovita slova se nezklonuji podle posledniho slova zkratky, doporucuji vyzkouset na Cedoku ;-)
    26.12.2012 14:29 falešný amig4poשer
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Toš ty jako správný moravák byz měl vědět, že správně je "v bash-u" :-)
    26.12.2012 20:03 Šangala | skóre: 56 | blog: Dutá Vrba - Wally
    Rozbalit Rozbalit vše Re: Když to v bash-i ulítne - výběr komprimační metody
    Toš to su a vím to, ale bárgde by tomu nerozuměli ;-)
    To, že trpíš stihomamem, ještě neznamená, že po tobě nejdou. ⰞⰏⰉⰓⰀⰜⰉ ⰗⰞⰅⰜⰘ ⰈⰅⰏⰉ ⰒⰑⰎⰉⰁⰕⰅ ⰏⰉ ⰒⰓⰄⰅⰎ ·:⁖⁘⁙†

    Založit nové vláknoNahoru

    ISSN 1214-1267   www.czech-server.cz
    © 1999-2015 Nitemedia s. r. o. Všechna práva vyhrazena.