-4
for m in {1..100}
    do
        r1=`shuf -n1 -i1-100`
        r2=`shuf -n1 -i1-100`
        if [[ "${r1}" -lt "${r2}" ]]
        then
            resstr=`echo "$m" | md5sum | cut -b ${r1}-${r2}`
        else
            resstr=`echo "$m" | md5sum | cut -b ${r2}-${r1}`
        fi
        str="."
        for n in `echo ${resstr}|fold -w1`
        do
          str="${str}/`shuf -n5 -i100-500| tr -d '\n'|md5sum |cut -b1-6`"
        done
        echo "mkdir -p ${str}"
    done

I tried to run it locally but ran into errors. Can someone explain what this does and how is this useful please?

closed as off-topic by jasonwryan, muru, Kusalananda, LinuxSecurityFreak, Kiwy Apr 10 '18 at 9:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – muru, Kusalananda, LinuxSecurityFreak, Kiwy

1

The script, which assumes bash or some other shell that does brace expansions, and that GNU coreutils is installed, outputs mkdir commands for creating some sort of directory structure where there directories have names from MD5 checksums calculated on random numbers.

Whether this is useful or not, I don't know. There's no immediate error in the script except for a few style issues and unquoted variable expansions.

Not the answer you're looking for? Browse other questions tagged or ask your own question.