summaryrefslogtreecommitdiff
path: root/graphs/piscine/generate_files/generate_files.sh
blob: cf2ba0a4452650d0374e5f34d2467a7585e62792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

FILENAME="default"
NUMBER="1"
EXTENSION="txt"

while [ $# -gt 0 ]; do
	case "$1" in
		'-f' | '--filename')
			shift
			FILENAME="$1"
			shift
			;;
		'-n' | '--number')
			shift
			NUMBER="$1"
			shift
			;;
		'-e' | '--extension')
			shift
			EXTENSION="$1"
			shift
			;;
		*)
			exit 1
			;;
	esac
done

for i in $(seq 1 $NUMBER); do
	touch -- "$FILENAME-$i.$EXTENSION"
done