Skip to content

Instantly share code, notes, and snippets.

@SteveViss
Created February 26, 2015 15:29
Show Gist options
  • Save SteveViss/083623d7cbbde43bd811 to your computer and use it in GitHub Desktop.
Save SteveViss/083623d7cbbde43bd811 to your computer and use it in GitHub Desktop.
Create fake files for testing procedure using batch
#!/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