public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* dircolors generates output with '\r\n' ?
@ 2014-01-30 17:05 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-01-30 18:21 ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 5+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-01-30 17:05 UTC (permalink / raw)
  To: cygwin

Hi,

I was trying to use the dircolor command on CYGWIN, and it did not work because
the two lines, which this command produces are separated by CRLF (which when
sourced by bash are not understood, bash seems to expect single LFs):

LS_OPTIONS='...';\r\n
export LS_OPTIONS\r\n

Why there are Windows-style EOLs in there?

Thanks,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dircolors generates output with '\r\n' ?
  2014-01-30 17:05 dircolors generates output with '\r\n' ? Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-01-30 18:21 ` Larry Hall (Cygwin)
  2014-01-30 18:31   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Hall (Cygwin) @ 2014-01-30 18:21 UTC (permalink / raw)
  To: cygwin

On 1/30/2014 12:04 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> Hi,
>
> I was trying to use the dircolor command on CYGWIN, and it did not work because
> the two lines, which this command produces are separated by CRLF (which when
> sourced by bash are not understood, bash seems to expect single LFs):
>
> LS_OPTIONS='...';\r\n
> export LS_OPTIONS\r\n
>
> Why there are Windows-style EOLs in there?

If you edit the file with a native Windows editor, it will typically
introduce the Windows-style EOL characters.  Use 'dos2unix' or your
favorite utility to clean that up.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: dircolors generates output with '\r\n' ?
  2014-01-30 18:21 ` Larry Hall (Cygwin)
@ 2014-01-30 18:31   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-01-30 18:38     ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 5+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-01-30 18:31 UTC (permalink / raw)
  To: cygwin

> If you edit the file with a native Windows editor, it will typically
> introduce the Windows-style EOL characters.

I did not edit anything, I just ran "dircolors", and it's output contains "\r\n"s.

Anton Lavrentiev
Contractor NIH/NLM/NCBI

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dircolors generates output with '\r\n' ?
  2014-01-30 18:31   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-01-30 18:38     ` Larry Hall (Cygwin)
  2014-01-30 18:59       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Hall (Cygwin) @ 2014-01-30 18:38 UTC (permalink / raw)
  To: cygwin

On 1/30/2014 1:30 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> I did not edit anything, I just ran "dircolors", and it's output contains "\r\n"s.

Then one possibility is that you redirected it to a file that is mounted on
a file system that isn't binary.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: dircolors generates output with '\r\n' ?
  2014-01-30 18:38     ` Larry Hall (Cygwin)
@ 2014-01-30 18:59       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 0 replies; 5+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-01-30 18:59 UTC (permalink / raw)
  To: cygwin

> Then one possibility is that you redirected it to a file that is mounted on
> a file system that isn't binary.

There it was, indeed.  Thanks.  And sorry about my brain-f@rt.

Anton Lavrentiev
Contractor NIH/NLM/NCBI


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-30 18:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 17:05 dircolors generates output with '\r\n' ? Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-01-30 18:21 ` Larry Hall (Cygwin)
2014-01-30 18:31   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-01-30 18:38     ` Larry Hall (Cygwin)
2014-01-30 18:59       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).