Home > front end >  how to concatenate a string to a file in a For loop
how to concatenate a string to a file in a For loop

Time:09-17

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

CodePudding user response:

Add an echo or printf.

echo "Operating system" > txt_$i
  • Related