I am creating a script that will take user input for a file name, and number of files to be created.
The script will then create the number of files required, and use the name given but increment the file name by one each iteration.
So lets say I want 3 files, named boogey. The output in the home folder would be; boogey1.txt, boogey2.txt and boogey3.txt.
Here is the code I have so far.
#!/bin/bash
var1=1
echo -n "Enter the number of your files to create: [ENTER]: "
read file_number
var2=file_number
echo -n "Enter the name of your file: [ENTER]: "
read file_name
var3=file_name
while [ "$var1" -le $file_number]
do
cat $file_name.txt
#var1=$(( var1+1 ))
done