Apparently, the attachment in my previous email got dropped.  Here it is again.

- Howard

On Mon, 23 Oct 2006 12:29:31 -0400, Howard Mak wrote:

> I can't seem to get the latest version of bash to work with the command
>       PROGRAM `cat file_containing_arguments.txt`
> when the file is created on a textmode mount.  Seems like carriage returns 
> are not processed correctly.
>
> I've attached a test script illustrating the problem.
>
> Comments:
>
> -     The problem does not seem to appear in older version of bash (ver 
> 3.1.17(6))
>
> -     I tried using different settings for the shell option igncr, but it 
> didn't seem to help
>
> Thanks in advance for any help.
>
> - Howard
#!/usr/bin/bash
#
# Following 2 tests should both pass.
# Instead, 1st test fails in newer version of bash, but not on older version.

shopt -s igncr

pwd

# Result: /c/tmp

mount

# Result:
# c:\cygwin\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system 
(binmode)
# C:\cygwin\bin on /usr/bin type system (textmode)
# C:\cygwin\lib on /usr/lib type system (textmode)
# C:\cygwin on / type system (textmode)
# c: on /c type system (textmode)
# d: on /d type system (textmode)
# j: on /j type system (textmode)
# k: on /k type system (textmode)
# t: on /t type system (textmode)
# y: on /y type user (textmode)
# z: on /z type user (textmode)


################################################################################
# Test 1
# Passes in bash 3.1.17(6)-release
# Fails  in bash 3.1.17(9)-release

echo bar.txt > bar.txt

od -c bar.txt

# Result:
# 0000000   b   a   r   .   t   x   t  \r  \n
# 0000011

notepad `cat bar.txt`

# Open fails because `cat` output returns CR?

################################################################################
# Test 2
# Passes in bash 3.1.17(6)-release
# Passes in bash 3.1.17(9)-release

dos2unix -U bar.txt

od -c bar.txt

# Result:
# 0000000   b   a   r   .   t   x   t  \n
# 0000010

notepad `cat bar.txt`

--
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/

Reply via email to