Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/test/h_touchdir.sh
2010-10-22 13:59:14 +02:00

27 lines
448 B
Bash
Executable file

#!/bin/bash
#
# Helper for touching a number of files in a directory.
if [ $# -lt 1 ]; then
echo "usage: $0 <dir> [ <nfiles> ]"
exit 1
fi
if [ ! -d $1 ]; then
echo "ERROR: '${1}' is not a directory"
exit 1
fi
NFILES=1024
if [ $# -gt 1 ]; then
if [ ! -z "${2##[0-9]*}" ]; then
echo "ERROR: '${2}' is not a positive integer"
exit 1
fi
NFILES=$2
fi
for i in `seq 0 ${NFILES}`; do
touch "${1}/file${i}"
done