Home > front end >  How can I print all outputs of this in newline instead in one line
How can I print all outputs of this in newline instead in one line

Time:12-10

I want to get:

  • day1
  • day2
  • day3
  • ... as output and then input it into a text file

echo -e day{1..360} > dif2.txt But I didn't got desired result

CodePudding user response:

echo day{1..360}|tr ' ' '\n' >  dif2.txt

There's no way to insert newlines into the sequence (without also producing leading spaces for all but the first entry) within the echo.

If whitespace doesn't matter you could do:

echo -e day{1..360}'\n' >  dif2.txt
  • Related