Last active
February 7, 2017 17:00
-
-
Save vallieres/7aaaad64f332bc1b701c8f79c2ed6480 to your computer and use it in GitHub Desktop.
Generate 1000 files with random characters as content of the length of the index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generates 1000 files with name from 1.txt to 1000.txt, each file has a random set of letters and number equivalent to the number its filename. | |
# For example, 12.txt has a string of 12 chars inside it. | |
for i in {0001..1000} | |
do | |
CONTENT=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w $i | head -n 1) | |
echo $CONTENT > "file_${i}.txt" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment