Subject: Re: HOME and bash
From: [email-masked] (Jim Balter)

23 Jan 1997 19:31:14 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <c=US%a=_%p=OrCAD%l=[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Original-To: Ron Forrester <[email-masked]>
Original-CC: "'Gnu-Win32'" <[email-masked]>
Original-Sender: [email-masked]

Ron Forrester wrote:
> 
> I just installed b17.1, and so far things are overall really great!
> 
> However, I am trying to get the ~/ functionality from bash that I am
> used to. In my .bashrc file, I have the following line:
> 
> export HOME=/usr/rjf
> 
> which is indeed where I want ~ to point.
> 
> After starting up bash, I see that the above is really in my
> environment. Issuing the command cd ~/source, bash goes away for a while
> (30+ seconds), then comes back with:
> 
> bash: c:usrrjf/source: No such file or directory

Somewhere your HOME is being defined as c:\usr\rjf,
and bash ignores the backslashes, yielding "c:usrrjf".

What exactly does your .bashrc contain?  If it contains any carriage
returns, you have hit an infamous bug, discussed recently on this list.
Compare ls -l .bashrc to wc .bashrc; if they report different
character counts, you have the problem.  You can filter out the
CR's with any of various tools (not including tr, related to the
same (text mode) problem, sigh), get the patch recently posted here,
mount c: with the -b flag if you know what you are doing and are brave,
or write a filter using some simple C code like

	while ((c = getchar()) != EOF)
		if (c != '\r')
			putchar(c);

[SOAPBOX MODE]
Right now, there are dozens of bugs in the tools and their use due
to text mode.  I suggest that this is an area that could use some
careful rethinking.  My own opinion is that the tools should default
to binary mode but should open in text mode when a filename has some
special form, such as crnl:foo or dos:foo.  This wouldn't allow text
opens via shell redirection, but that would be a small price to pay to
make od, tr, gzip, tar, cat, etc. ad nauseam work properly with
redirection.

--
<J Q B>
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".