This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Text file created from the keyboard is DOS termninated


I am set up for "Unix" rather than "DOS" and created a text file directly
from the keyboard by typing

$ cat > textfile
this is line1 <press Enter>
this is line2 <press Enter>
<press Ctrl-D>
$

It turns out that the two-line file textfile created by this method, is
DOS-terminated. I was kind of thinking it would (should?) be
Unix-terminated. I know there are 100 threads on line termination, but in
contexts more sophisticated than this. Please can somebody tell me whether
this is a bug; or meant to happen (if so, why); or comment with assurance
that my "Unix" set-up must be faulty in some way (correctable?)

Thank you. By the way, if I try

$ cat > textfile << X
> this is line1 <press Enter>
> this is line2 <press Enter>
> X <press Enter>
$

(where > is the provided prompt) then the two-line file textfile is
Unix-terminated.

Fergus


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]