Skip to content

Instantly share code, notes, and snippets.

@UltimateByte
Created April 27, 2017 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UltimateByte/993a07ae5fa9b7f28c3f384140729ab2 to your computer and use it in GitHub Desktop.
Save UltimateByte/993a07ae5fa9b7f28c3f384140729ab2 to your computer and use it in GitHub Desktop.
Create many files
#!/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