delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/05/13:45:40

X-Spam-Check-By: sourceware.org
Message-ID: <8183547.post@talk.nabble.com>
Date: Fri, 5 Jan 2007 10:45:23 -0800 (PST)
From: fschmidt <fschmidt AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: CR/LF problems after upgrade
In-Reply-To: <459E51AA.5020300@byu.net>
MIME-Version: 1.0
X-Nabble-From: fschmidt AT gmail DOT com
References: <8174573 DOT post AT talk DOT nabble DOT com> <012901c730be$ac6ca7f0$0708090a AT CAM DOT ARTIMI DOT COM> <459E51AA DOT 5020300 AT byu DOT net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

from http://cygwin.com/ml/cygwin-announce/2006-12/msg00026.html



> 2. d2u is your friend.  You can use it to convert any problematic script
> into binary line endings.
> 

Several people I work with, who are even less technical than I am, use
cygwin and edit scripts with various editors.  So this will not work.



> 3. Cygwin text mounts automatically work with either line ending style,
> because the \r is stripped before bash reads the file.  If you absolutely
> must use files with \r\n line endings, consider mounting the directory
> where those files live as a text mount.  However, text mounts are not as
> well tested or supported on the cygwin mailing list, so you may encounter
> other problems with other cygwin tools in those directories.
> 

I don't know what mounts are, or how to use them.



> 4c. To affect all scripts, export the environment variable BASH_ENV,
> pointing to a file that sets the shell option as desired.  Bash will
> source this file on startup for every script.
> 

I tried:

cd /etc
echo '(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed'
>bash_env
export BASH_ENV=/etc/bash_env

This did not work.



> 4d. Added in the bash-3.2-2 release: export the environment variable
> SHELLOPTS with igncr included in it.  It is read-only from within bash,
> but you can set it before invoking bash; once in bash, it auto-tracks the
> current state of 'set -o igncr' or 'shopt -s igncr'.  If exported, then
> all bash child processes inherit the same option settings.
> 

I tried:

export SHELLOPTS=$SHELLOPTS:igncr

and got:

bash: SHELLOPTS: readonly variable



> 5. You can also experiment with the IFS variable for controlling how bash
> will treat \r during variable expansion.
> 

I don't know what the IFS variable is, or how to use it.

-- 
View this message in context: http://www.nabble.com/CR-LF-problems-after-upgrade-tf2924445.html#a8183547
Sent from the Cygwin Users mailing list archive at Nabble.com.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019