Hi I have a program where if the user inputs a filename I read form the file else I will prompt them for input.
Currently I am doing:
input=$(cat)
echo $input>stdinput.txt
file=stdinput.txt
The problem with this is it doesn't read the newline characters in input, for example if I input
s,5,8
kyle,5,34,2
j,2
output
s,5,8 k,5,34,2 j,2
The intended output to be stored in a file is
s,5,8
kyle,5,34,2
j,2
I need to know how to include the newline character while reading.?