Skip to content

Instantly share code, notes, and snippets.

@tlberglund
Created January 9, 2014 18:54
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tlberglund/8339793 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Ensure we have the quantity specified on the CLI
if [ -z "$3" ]; then ARG_ERR=ERR; fi
if [ -z "$2" ]; then ARG_ERR=ERR; fi
if [ -z "$1" ]; then ARG_ERR=ERR; fi
if [ -n "$ARG_ERR" ];
then
echo "Usage: <filecount> <filenamebase> <filenameextension>"
exit
fi
count=$1
filenamebase=$2
filenameextension=$3
for (( filenumber = 1; filenumber <= $count ; filenumber++ )); do
echo "Some new random text: $RANDOM" >> $filenamebase$filenumber.$filenameextension
git add $filenamebase$filenumber.$filenameextension
git commit -m"A random change of $RANDOM to $filenamebase$filenumber.$filenameextension"
done
@tlberglund
Copy link
Author

Ruthlessly stolen collaborated from @matthewmccullough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment