Hello so I've stored some csv data to be read into variables like this
Name,Team,Shop,Shoe
etc,etc,etc,etc
Code:
sep=","
{
while IFS=$sep read Name Team Shop Shoe
do
count=1
dirname=$Name
while [ -d "$dirname" ]
do
((count++))
dirname="${Name}$count"
done
mkdir -p $dirname/{Personal,Food,Pictures}
#(1)
echo "Hello my name is $Name i play for $Team i shop at $Shop and my shoe size is $Shoe" < $dirname/Personal/starter.txt
done } <$file_name
When using the mkdir
command to make the directories based on $dirname
it works perfectly and i get all directories made based on each name, however when trying to Echo text into a file called starter.txt
it gives me an error says the file or name doesn't exist. I'm trying to get it to generate ths file for every user. This is the full error
Paul/Personal/starter.txt: No such file or directory
this lists this error 20 times because of 20 users and 20 differnty names however is finding directory but not making file?
please help.