How to solve bash syntax error on writing in a file without opening? : a bash syntax error problem

i am writing a script to insert information in files without opening the file

for i in 1 2 3 do echo This is a sample text > sample-$i.txt done

