Created
February 12, 2019 11:31
-
-
Save sdmcraft/be8ad958f5dbcd38a07d2d47afff62a1 to your computer and use it in GitHub Desktop.
Revisions
-
sdmcraft created this gist
Feb 12, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash usage() { echo -e "Usage: $0 -i <input folder path containing files to append garbage> -b <garbage size>" \ "\nExample Usage: ./append-garbage.sh -i ~/Pictures/000-large -b 10M" 1>&2; exit 1; } while getopts i:b: option do case "${option}" in i) SOURCE_FOLDER=${OPTARG};; b) GARBAGE_SIZE=${OPTARG};; *) usage;; esac done dd if=/dev/zero of=garbage.dat bs=$GARBAGE_SIZE count=1 for FILE in $SOURCE_FOLDER/* do cat garbage.dat >> $FILE done rm garbage.dat