Created
April 27, 2017 14:48
-
-
Save UltimateByte/993a07ae5fa9b7f28c3f384140729ab2 to your computer and use it in GitHub Desktop.
Create many files
This file contains 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 | |
# Settings | |
subdir="manyiles" | |
echo "Starting" | |
echo "How many files do you wanna generate ?" | |
read -r amount | |
if [ ! -d "${subdir}" ]; then | |
mkdir -pv "${subdir}" | |
fi | |
fn_echo_text(){ | |
touch "${file}" | |
echo " This is some random text | |
What are you gonna do with it ? 1337 lol" > "${file}" | |
} | |
echo "Generating ${amount} files..." | |
sleep 2 | |
echo "" | |
i="0" | |
while [ "${i}" -lt "${amount}" ] ; do | |
let i++ | |
file="${subdir}/file_${i}" | |
fn_echo_text | |
echo -en "\r${i}/${amount}" | |
done | |
echo "" | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment