linux shell script input line

quick question, how do I write a shell script that prompts users to enter let say 5 lines and it will stores those lines into a .txt file for example,

Today is hot 
Today is code 
Today is chilly
Today is windy
Today is sunny

not like

Today is hot  Today is code  Today is chilly Today is windy today is sunny

Thanks for your help

Answers


In bash you can do:

for i in {1..5}
do
  read line
  echo $line >> file.txt
done

Does this count?

sed 5q > file.txt

Need Your Help

Python style: for-in syntax, checking for empty lists and dictionaries

python list idioms

I'm new to python and haven't yet read a lot of code to verify which styles are considered 'pythonic'.

Which is more efficient to use on a mobile platform SVM or Neural Networks ?

android machine-learning artificial-intelligence neural-network svm

I'm currently working on a framework for emotions and I'm planing on using input from a camera on a mobile platform to recognize the user's current emotional expression, using the CI2CV i managed to