-
-
Save uttaravadina/fc9f5ed2d7b41b08884882f79a24e350 to your computer and use it in GitHub Desktop.
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 | |
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment