how to concatenate a string to a file in a For loop

Viewed 55

I need to create files for the user with the words "operating system" inside. I have tried in many ways but I can't figure out which is the best way, for now, this way is the "best" (it creates the files but is empty)..

read n
for i in $(seq $n)
do
     "Operating system" > txt_$i
done
1 Answers

Add an echo or printf.

echo "Operating system" > txt_$i
Related