Last active
July 12, 2019 03:33
-
-
Save jzk/198c706b6c58ba77b42f9babbc44291d to your computer and use it in GitHub Desktop.
[A shell script creates massive dummy files] 这个脚本会创建大量的dummy的文件 #shell
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
LIMIT=$1 | |
GROUP_SIZE=$2 | |
FILEPATH=$3 | |
GROUP_NUMBER=0 | |
for i in $(seq 1 $LIMIT); | |
do | |
TIMESTAMP=$(date +%s) | |
FILENAME=$FILEPATH/$TIMESTAMP-$i-archive.txt | |
echo "someText" > $FILENAME | |
touch -t ''011${GROUP_NUMBER}0000'' $FILENAME | |
if [ "$(($i % ($LIMIT/$GROUP_SIZE)))" -eq "0" ]; then | |
((GROUP_NUMBER+=1)); | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment