Setting env variable to newline char?



How can I set an environment variable to the newline character in
normal bourne shell?

I want to set the $IFS variable to only be the newline character,
because I am trying to run a for loop against a file, line by line,
but the lines have spaces so the default value of $IFS messes me up -
I want it to split by lines.

i.e. for line in $(cat myfile.txt)

Any help appreciated, thanks!

.



Relevant Pages

  • Re: select line from file, and then the next line a week later
    ... >> EOF ... read previously and a newline character. ... then opened for reading and sendmail stdin is then connected to ...
    (comp.unix.shell)
  • Re: Stupid cat tricks - Anyone have other tricks?
    ... bash or ksh) is an operator by itself different from the $ ... Even if we assume X is a text file, the trailing newline ... (where is a newline character), cat is passed 5 arguments: ...
    (comp.unix.shell)
  • Re: Font paths
    ... Anne Wilson wrote: ... I have checked that there is no space or newline character after the line. ... $ cat /etc/fonts/local.conf ...
    (Fedora)