Created
February 26, 2015 15:29
-
-
Save SteveViss/083623d7cbbde43bd811 to your computer and use it in GitHub Desktop.
Create fake files for testing procedure using batch
This file contains 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 | |
# Script to create empty files in the specified folder. | |
if [ -z "$1" ]; then | |
echo "Enter the destination folder as a parameter." | |
exit | |
elif [ ! -d "$1" ]; then | |
echo "No such folder." | |
exit | |
fi | |
# Change folder and discard output and errors | |
cd $1 1> /dev/null 2>&1 | |
read -p "Enter the no. of empty files: " fileno | |
echo "Creating empty files..." | |
for ((i=1; i<=fileno; i++)) | |
do | |
touch fb$i.mat | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment